Open dmytrol opened 1 month ago
I totally agree, that just turned about to be quite painful to implement without some better help from the http library to understand the mapping. As a workaround for now you should be able to use @example
on the parameter itself.
But basically we need the following for this:
As a workaround for now you should be able to use @example on the parameter itself.
@timotheeguerin Many thanks for the hint! I did try that, but, alas, it didn't work. Maybe because the types of my parameters are scalars that do have their own @example
decorator applied at the scalar level.
However, in the end none of the examples (neither the one at the scalar definition level nor the one at the parameter level) get promoted to the operation definition YAML (but should they? 😕 ). The generated YAML is something like:
# -------- some operation ---------
parameters:
- name: host
in: path
required: true
schema:
$ref: '#/components/schemas/host'
# -------- schemas ----------
host:
type: string
example: api.www
minLength: 1
maxLength: 255
format: hostname
ah yeah no i wouldn't expect to be promoted up, just saying this so it gets included in the spec
Clear and concise description of the problem
Currently it looks like
@opExample
can only be used to provide example values for payloads in the request body. It would be extremely useful to add an ability to provide examples for path / query string parameters as well.Checklist