Skip to content

Commit

Permalink
Fix degradation of default in query params
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Jan 30, 2024
1 parent 46dad61 commit ae57865
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions openapify/core/base_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ def schema_helper(
schemas = self.spec.components.schemas
for name, schema in builder.context.definitions.items():
schemas[name] = schema.to_dict()
if isinstance(obj, QueryParam) and obj.default is not None:
json_schema.default = obj.default
return json_schema.to_dict()
2 changes: 0 additions & 2 deletions openapify/core/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ def _build_query_params(
)
if parameter_schema is None:
parameter_schema = {}
if param.default is not None:
parameter_schema["default"] = param.default
result.append(
openapi.Parameter(
name=name,
Expand Down

0 comments on commit ae57865

Please sign in to comment.