Skip to content

Commit

Permalink
Bugfix any converter to openapi schema
Browse files Browse the repository at this point in the history
The schema was previously extending the body schema and hence
incorrect.
  • Loading branch information
pgjones committed Jun 5, 2024
1 parent 4ff2aa5 commit 125e218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/quart_schema/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def _build_path(func: Callable, rule: Rule, app: Quart) -> Tuple[dict, dict]:
type_ = "number"

if isinstance(converter, AnyConverter):
schema["enum"] = list(converter.items)
schema = {"enum": list(converter.items)}

This comment has been minimized.

Copy link
@jwthomp

jwthomp Jun 6, 2024

Should this be?
schema = {"type": "string", "enum": list(converter.items)}

This comment has been minimized.

Copy link
@pgjones

pgjones Jun 7, 2024

Author Owner

I don't think so, https://json-schema.org/understanding-json-schema/reference/enum, unless I'm missing something?

else:
schema = {"type": type_}

Expand Down

0 comments on commit 125e218

Please sign in to comment.