parameters are unique as long as name and location are unique.

This commit is contained in:
Gerhard Weis 2019-06-20 05:09:33 +10:00
parent a1dfaf6adb
commit a8248a53da

View file

@ -328,27 +328,6 @@ class TestPathItemParamsValidator(object):
assert result.body is None
assert result.parameters == {}
@pytest.mark.xfail
def test_request_override_invalid_param(self, spec_dict):
# override parameter path parameter on operation
# This here should result in an invalid spec object, because there are
# now two parameters with the same name, but different location.
# (The openapi3 spec is also not very explicit about this case)
spec_dict["paths"]["/resource"]["get"]["parameters"] = [
{
# full valid parameter object required
"name": "resId",
"in": "path",
"required": False,
"schema": {
"type": "integer",
},
}
]
from openapi_spec_validator.exceptions import OpenAPIValidationError
with pytest.raises(OpenAPIValidationError):
create_spec(spec_dict)
class TestResponseValidator(object):