papsign / Ktor-OpenAPI-Generator

Ktor OpenAPI/Swagger 3 Generator
Apache License 2.0
241 stars 42 forks source link

Support for model parameter descriptions #52

Closed bherbst closed 4 years ago

bherbst commented 4 years ago

I would love to be able to annotate model properties with descriptions, like we can do with @HeaderParam, @PathParam, and @QueryParam, and it doesn't look like that is currently possible.

I'd imagine something like the new @OpenAPIName would work well.

Wicpar commented 4 years ago

I won' t be able to implement anything of that kind until the week after the next, but if you want to take a shot at it you can:

  1. Add the description property to the schemaModel https://github.com/papsign/Ktor-OpenAPI-Generator/blob/master/src/main/kotlin/com/papsign/ktor/openapigen/model/schema/SchemaModel.kt
  2. Create a validator to edit the properties you want (validators are type annotations, look at @Min, @Max, @Clamp and how they are implemented)

OpenAPIName was a special case because it changed serialization/deserialization behavior.

Wicpar commented 4 years ago

Thank you for the contributions :), merged and released.