File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
end_to_end_tests/generator_errors_and_warnings Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -12,24 +12,16 @@ def warnings(self):
1212"""
1313components:
1414 schemas:
15- ModelType1:
16- type: object
17- properties:
18- modelType: {"type": "string"}
19- name: {"type": "string"}
20- required: ["modelType"]
21- ModelType2:
22- type: object
23- properties:
24- modelType: {"type": "string"}
25- name: {"type": "string"}
26- required: ["modelType"]
2715 UnionWithInvalidReference:
2816 anyOf:
2917 - $ref: "#/components/schemas/DoesntExist"
3018 UnionWithInvalidDefault:
3119 type: ["number", "integer"]
3220 default: aaa
21+ UnionWithMalformedVariant:
22+ anyOf:
23+ - type: string
24+ - type: array # invalid because no items
3325"""
3426 )
3527
@@ -39,6 +31,9 @@ def test_invalid_reference(self, warnings):
3931 def test_invalid_default (self , warnings ):
4032 assert_bad_schema_warning (warnings , "UnionWithInvalidDefault" , "Invalid int value: aaa" )
4133
34+ def test_invalid_property (self , warnings ):
35+ assert_bad_schema_warning (warnings , "UnionWithMalformedVariant" , "Invalid property in union" )
36+
4237
4338class TestInvalidDiscriminators :
4439 @pytest .fixture (scope = "class" )
You can’t perform that action at this time.
0 commit comments