postman-to-openapi icon indicating copy to clipboard operation
postman-to-openapi copied to clipboard

Feature request: ability to use description for default value

Open EloB opened this issue 3 years ago • 1 comments

I would like the same functionality like required where you can set it through description. My suggestion is to support all these: [required] [default="foobar"] [required] [default="foobar"] [default=1337]

Example:

paths:
  /hello
    parameters:
     - name: world
       in: query
       required: true
       schema:
         type: string
         default: "foobar"

EloB avatar Jun 29 '22 20:06 EloB

Hi @EloB,

An interesting feature, but there are some rules that should take into consideration, for example as specified in describing-parameters required and default doesn´t make sense, and there are also lot of considerations in terms of the type of the default that should match with the parameter type and so on... so is not as easy as seems as a first glance, but interesting aproach.

Best regards.

joolfe avatar Jul 10 '22 11:07 joolfe

Closed due to inactivity

joolfe avatar Nov 05 '22 14:11 joolfe