Skip to content

Commit

Permalink
bugfix/restore optional default parameter value #226
Browse files Browse the repository at this point in the history
  • Loading branch information
tfranzel committed Dec 8, 2020
1 parent ec97e52 commit 4b53cea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drf_spectacular/plumbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ def build_parameter_type(
explode=None,
style=None
):
irrelevant_field_meta = ['readOnly', 'writeOnly', 'nullable', 'default']
irrelevant_field_meta = ['readOnly', 'writeOnly']
if location == OpenApiParameter.PATH:
irrelevant_field_meta += ['nullable', 'default']
schema = {
'in': location,
'name': name,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_extend_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ paths:
- a
- b
type: string
default:
- a
- in: query
name: stars
schema:
Expand Down

0 comments on commit 4b53cea

Please sign in to comment.