Examples not used?
splitbrain opened this issue · comments
Andreas Gohr commented
When adding examples to individual parameters in a requestBody, they seem not to be picked up. The suggested body is still empty:
When using the swagger editor, the values show up as expected:
Here's the setup (OpenAPI 3.1):
{
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"type": "object",
"properties": {
"user": {
"type": "string",
"description": "The Username",
"examples": [
"some-user"
]
},
"pass": {
"type": "string",
"description": "The Password",
"examples": [
"some-pass"
]
}
}
}
}
}
}
}
Warren Parad commented
There was a protection in place, because we don't want to default certain values. Realistically the defaults should only be restricted to fields that likely end in id
, so I'm updating this to enable the other ones to work.