Skip to content

Commit

Permalink
Minor rework of test_field2property_nested_spec_metadatas
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Dec 2, 2024
1 parent a52e7bc commit a37c3e5
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions tests/test_ext_marshmallow_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,25 +438,15 @@ class Child(Schema):
)
result = spec_fixture.openapi.field2property(category)
version = spec_fixture.openapi.openapi_version
if version.major < 3:
if version.major < 3 or version.minor < 1:
assert result == {
"allOf": [
{"$ref": "#/definitions/Child"},
],
"description": "A category",
"x-extension": "A great extension",
}
elif version.minor < 1:
assert result == {
"allOf": [
{"$ref": "#/components/schemas/Child"},
],
"allOf": [build_ref(spec_fixture.spec, "schema", "Child")],
"description": "A category",
"x-extension": "A great extension",
}
else:
assert result == {
"$ref": "#/components/schemas/Child",
**build_ref(spec_fixture.spec, "schema", "Child"),
"description": "A category",
"x-extension": "A great extension",
}
Expand Down

0 comments on commit a37c3e5

Please sign in to comment.