Skip to content

Commit

Permalink
No additional validations in case of types in response_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmackaij committed Dec 3, 2024
1 parent 4f24c6a commit e6716a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/OpenApiLibCore/openapi_libcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,11 @@ def validate_response(
response_spec["content"][content_type]["schema"]
)

response_types = response_schema.get("types")
if response_types:
# In case of oneOf / anyOf there can be multiple possible response types
# which makes generic validation too complex
return None
response_type = response_schema.get("type", "undefined")
if response_type not in ["object", "array"]:
self._validate_value_type(value=json_response, expected_type=response_type)
Expand Down

0 comments on commit e6716a0

Please sign in to comment.