Skip to content

Commit

Permalink
fix comment spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
schew2381 committed Feb 8, 2024
1 parent d454688 commit bebcdb7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/sentry/apidocs/spectacular_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,11 @@ def resolve_type_hint(hint) -> Any:
else:
schema = resolve_type_hint(type_args[0])
if type(None) in args:
# There's an issue where if 3 types are OR'd together and one of
# them is None, validating the schema will fail because "nullable:
# true" with "anyOf" raises an error because there is no "type" key
# on the schema. This works around it by including a proxy null
# object in the "anyOf".
# See https://github.com/OAI/OpenAPI-Specification/issues/1368.
# There's an issue where if 3 or more types are OR'd together and one of
# them is None, validating the schema will fail because "nullable: true"
# with "anyOf" raises an error because there is no "type" key on the
# schema. This works around it by including a proxy null object in
# the "anyOf". See https://github.com/OAI/OpenAPI-Specification/issues/1368.
if len(args) > 2:
schema["oneOf"].append({"type": "object", "nullable": True})
else:
Expand Down

0 comments on commit bebcdb7

Please sign in to comment.