javalin / javalin-openapi

Annotation processor for compile-time OpenAPI & JsonSchema, with out-of-the-box support for Javalin 5.x, Swagger & ReDoc
https://github.com/javalin/javalin-openapi/wiki
Apache License 2.0
45 stars 17 forks source link

Support all utility OpenApi annotations on fields #217

Open dzikoysk opened 4 months ago

dzikoysk commented 4 months ago

Context

Most of the property attributes work fine and make sense on fields, but don't currently support being put there. This fixes that limitation, which is useful when using @OpenApiByFields. (My immediate use case is OpenApiDescription, but the others seemed useful too.)

~ Reported by @maths22 in https://github.com/javalin/javalin-openapi/pull/216


Feedback wanted

I personally feel like most of the use cases should be absolutely fine with our current approach, but I'm open for feedback from other users that for some reason are forced to use fields.

As a straightforward solution, it is possible to cover this with @CustomAnnotation, but if we'll notice it is a frequent issue, I think we could support it in the core library.