nielsfalk / ktor-swagger

Apache License 2.0
133 stars 38 forks source link

Example value for Parameters #26

Open IzabellaMConigliaro opened 5 years ago

IzabellaMConigliaro commented 5 years ago

Is there a way to add and example values for parameters?

Currently I have this Paramenters Class: class QueryParameter(@DefaultValue("2019") @Description("Maximum released year") val yearMax: Int?)

And my swagger Ui is like this: image

I don't want a "default value", but actually an example that auto populate the field when trying the endpoint. Is it possible to add an example value to a parameter?

JLLeitschuh commented 5 years ago

I thought about allowing annotation based defaults, but I never implemented it. If you have an interest in adding it, please open a PR.