Unable to set default parameters when using with Marshmallow schemas
- Dominant language
- Python
- Stars
- 652
- Forks
- 151
- PR merge metrics
- No merged PRs in 30d
Description
I have this Marshmallow Schema:
```
class ApplyPromoResponse(Schema):
testfield = fields.Str(missing='abcd',default='abcd', metadata={example='abcd'})
```
And I'm using it like this:
`@marshal_with(ApplyPromoResponse, code=200)`
This is what I get on Swagger UI:

On clicking the `Try it out` button, I get this:

Basically I want the default parameters to be set so that I don't have to manually type them while trying GET and POST requests. Hence, what I want to get on clicking the `Try it out` button is:

I have the `missing`, `default` and `example` fields specified in the Marshmallow Schema but it's not working. Can anyone help debug this issue? Thanks!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with ApplyPromoResponse, @marshal_with(...), and Swagger UI's Try it out flow; first compare how the Marshmallow missing, default, and example values appear in the generated schema. Done means Swagger UI shows the requested default values without requiring manual entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100