diff --git a/openapi_spec_validator/resources/schemas/v3.0.0/schema.json b/openapi_spec_validator/resources/schemas/v3.0.0/schema.json index b199631..7b414d8 100644 --- a/openapi_spec_validator/resources/schemas/v3.0.0/schema.json +++ b/openapi_spec_validator/resources/schemas/v3.0.0/schema.json @@ -433,7 +433,15 @@ "content": { "$ref": "#/definitions/mediaTypes" } - } + }, + "oneOf": [ + { + "required": [ "schema" ] + }, + { + "required": [ "content" ] + } + ] }, "requestBody": { "type": "object", @@ -665,7 +673,15 @@ "content": { "$ref": "#/definitions/mediaTypes" } - } + }, + "oneOf": [ + { + "required": [ "schema" ] + }, + { + "required": [ "content" ] + } + ] }, "tag": { "type": "object", @@ -1250,4 +1266,4 @@ ] } } - } \ No newline at end of file + } diff --git a/tests/integration/test_validators.py b/tests/integration/test_validators.py index a1e5acd..1eee91b 100644 --- a/tests/integration/test_validators.py +++ b/tests/integration/test_validators.py @@ -61,10 +61,16 @@ def test_same_parameters_names(self, validator): { 'name': 'param1', 'in': 'query', + 'schema': { + 'type': 'integer', + }, }, { 'name': 'param1', 'in': 'path', + 'schema': { + 'type': 'integer', + }, }, ], }, @@ -120,6 +126,9 @@ def test_undocumented_parameter(self, validator): { 'name': 'param1', 'in': 'path', + 'schema': { + 'type': 'integer', + }, }, ], },