Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
Still got some work to do, the recursive test still fails
  • Loading branch information
percivalalb committed Jun 17, 2024
1 parent 2b0efa4 commit 8f7923c
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 22 deletions.
5 changes: 4 additions & 1 deletion openapi3/testdata/callbacks.yml.internalized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
},
"SomePayload": {
"type": "object"
},
"testdata_callbacks_SomePayload": {
"type": "object"
}
}
},
Expand Down Expand Up @@ -82,7 +85,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SomePayload"
"$ref": "#/components/schemas/testdata_callbacks_SomePayload"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/schemas_book_record"
"$ref": "#/components/schemas/testdata_interalizationNameCollision_schemas_book_record"
}
}
}
Expand All @@ -31,7 +31,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/schemas_cd_record"
"$ref": "#/components/schemas/testdata_interalizationNameCollision_schemas_cd_record"
}
}
}
Expand All @@ -42,7 +42,7 @@
},
"components": {
"schemas": {
"schemas_book_record": {
"testdata_interalizationNameCollision_schemas_book_record": {
"type": "object",
"required": [
"id"
Expand All @@ -56,7 +56,7 @@
}
}
},
"schemas_cd_record": {
"testdata_interalizationNameCollision_schemas_cd_record": {
"type": "object",
"required": [
"id"
Expand Down
6 changes: 3 additions & 3 deletions openapi3/testdata/issue959/openapi.yml.internalized.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"components": {
"schemas": {
"External1": {
"testdata_issue959_components_External1": {
"type": "string"
}
}
Expand All @@ -26,10 +26,10 @@
"name": "external1",
"required": true,
"schema": {
"$ref": "#/components/schemas/External1"
"$ref": "#/components/schemas/testdata_issue959_components_External1"
}
}
]
}
}
}
}
64 changes: 55 additions & 9 deletions openapi3/testdata/recursiveRef/openapi.yml.internalized.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"components": {
"parameters": {
"parameters_number": {
"testdata_recursiveRef_parameters_number": {
"in": "query",
"name": "someNumber",
"schema": {
Expand All @@ -10,34 +10,80 @@
}
},
"responses": {
"testdata_recursiveRef_openapi_400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/testdata_recursiveRef_components_models_error"
}
}
},
"description": "400 Bad Request"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
"$ref": "#/components/schemas/testdata_recursiveRef_components_models_error"
}
}
},
"description": "400 Bad Request"
}
},
"schemas": {
"Bar": {
"testdata_recursiveRef_openapi_Bar": {
"example": "bar",
"type": "string"
},
"testdata_recursiveRef_openapi_Foo": {
"properties": {
"bar": {
"$ref": "#/components/schemas/testdata_recursiveRef_components_Bar"
}
},
"type": "object"
},
"testdata_recursiveRef_openapi_Foo2": {
"properties": {
"foo": {
"$ref": "#/components/schemas/testdata_recursiveRef_openapi_Foo"
}
},
"type": "object"
},
"testdata_recursiveRef_components_models_error":{
"title":"ErrorDetails",
"type":"object"
},
"testdata_recursiveRef_components_models_error_Error":{
"title":"ErrorDetails",
"type":"object"
},
"testdata_recursiveRef_openapi_Cat": {
"properties": {
"cat": {
"$ref": "#/components/schemas/testdata_recursiveRef_openapi_Cat"
}
},
"type": "object"
},
"Bar": {
"example": "bar",
"type": "string"
},
"Foo": {
"properties": {
"bar": {
"$ref": "#/components/schemas/Bar"
"$ref": "#/components/schemas/testdata_recursiveRef_components_Bar"
}
},
"type": "object"
},
"Foo2": {
"properties": {
"foo": {
"$ref": "#/components/schemas/Foo"
"$ref": "#/components/schemas/testdata_recursiveRef_openapi_Foo"
}
},
"type": "object"
Expand All @@ -49,7 +95,7 @@
"Cat": {
"properties": {
"cat": {
"$ref": "#/components/schemas/Cat"
"$ref": "#/components/schemas/testdata_recursiveRef_openapi_Cat"
}
},
"type": "object"
Expand Down Expand Up @@ -82,7 +128,7 @@
"schema": {
"properties": {
"foo2": {
"$ref": "#/components/schemas/Foo2"
"$ref": "#/components/schemas/testdata_recursiveRef_openapi_Foo2"
}
},
"type": "object"
Expand All @@ -92,13 +138,13 @@
"description": "OK"
},
"400": {
"$ref": "#/components/responses/400"
"$ref": "#/components/responses/testdata_recursiveRef_openapi_400"
}
}
},
"parameters": [
{
"$ref": "#/components/parameters/parameters_number"
"$ref": "#/components/parameters/testdata_recursiveRef_parameters_number"
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions openapi3/testdata/spec.yaml.internalized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"Test": {
"properties": {
"test": {
"$ref": "#/components/schemas/ext_definitions_b"
"$ref": "#/components/schemas/testdata_ext_definitions_b"
}
},
"type": "object"
},
"definitions_a": {
"testdata_ext_definitions_a": {
"type": "string"
},
"ext_definitions_b": {
"testdata_ext_definitions_b": {
"description": "I use a local reference.",
"properties": {
"name": {
"$ref": "#/components/schemas/definitions_a"
"$ref": "#/components/schemas/testdata_ext_definitions_a"
}
},
"type": "object"
Expand Down
2 changes: 1 addition & 1 deletion openapi3/testdata/testref.openapi.yml.internalized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"AnotherTestSchema": {
"type": "string"
},
"components_CustomTestSchema": {
"testdata_components_CustomTestSchema": {
"type": "string"
}
}
Expand Down

0 comments on commit 8f7923c

Please sign in to comment.