You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide a way to not auto-fill examples for certain parameters #686
We have some optional fields with examples. But, they still getting populated with first value from examples. The default can be set only inside examples. But, that also shows up in examples. So, is it possible to allow setting default outside?
Current: To show empty default for non-required fields.
Sorry for any confusion. This is actually a defect that optional fields are pre-populated with first value from examples. Can provide example if needed.
I would like to somehow hint in yaml schema that field should not be populated from example.
Examples are great and I can click on them to populate field with defaults.
Maybe some extension field x-example-fill: false or something?
get:
summary: content searchoperationId: seachContenttags:
- content-searchparameters:
- in: queryname: searchexamples:
a:
value: my example 1b:
value: "*"schema:
type: stringdescription: term to search (use "*" to show all)
- in: queryname: idexample: my-idschema:
type: string
- in: queryname: dbexample: cccschema:
type: stringenum:
- aaa
- bbb
- ccc
- dddresponses:
200:
description: OKcontent:
application/json: {}400:
$ref: "../response/400.yaml"
use vendor extension x-example-fill : no for each parameter to indicate if it should be filled
you may also use RapiDoc attribute fill-request-fields-with-example = true/false to indicate no autofilling of example for the entire spec
get:
summary: content searchoperationId: seachContenttags:
- content-searchparameters:
- in: queryname: searchexample: 'my-search-string'x-fill-example: no # <--- vendor extensionschema:
type: stringdescription: term to search (use "*" to show all)
- in: queryname: idexample: my-idschema:
type: string
Activity
mrin9 commentedon Mar 9, 2022
I am not sure whats the ask here. Can you explain with some screen shot may be, what are you getting and what do you intent to have
majoshi1 commentedon Mar 9, 2022
Sorry for any confusion. This is actually a defect that optional fields are pre-populated with first value from examples. Can provide example if needed.
hrvoj3e commentedon Mar 15, 2022
I have the same problem.
I would like to somehow hint in yaml schema that field should not be populated from example.
Examples are great and I can click on them to populate field with defaults.
Maybe some extension field
x-example-fill: falseor something?mrin9 commentedon Mar 22, 2022
I think thats a good suggestion.
added to our queue
[-]Allow setting default outside examples[/-][+]Provide a way to not auto-fill examples for certain parameters[/+]mrin9 commentedon Mar 26, 2022
use vendor extension
x-example-fill : nofor each parameter to indicate if it should be filledyou may also use RapiDoc attribute
fill-request-fields-with-example = true/falseto indicate no autofilling of example for the entire specfixes rapi-doc#686 - vendor extension to allow stopping of auto-filli…