Quarkus not updating openapi schema to take JsonView into consideration

171 views
Skip to first unread message

Brand Bintley

unread,
Jul 28, 2021, 5:20:33 AM7/28/21
to Quarkus Development mailing list
I am having some challenges with JsonView and Swagger. Basically the annotations specified in the bean are nor reflected in the swagger documentation. It seems to be related to the openapi specification not taking the JsonView into consideration.

In Spring, dedicated schemas (e.g. $ref: '#/components/schemas/WorkflowDTO_Summary') are defined to reflect the JsonView annotation as per this article: https://www.gitmemory.com/issue/springdoc/springdoc-openapi/989/744725691.

Am I missing something?


David Hoffer

unread,
Jul 29, 2021, 12:40:15 PM7/29/21
to Quarkus Development mailing list
I assume you are using the quarkus-smallrye-openapi approach?  In our projects that use that we don't use JsonView so can't say if that works or not.  However in another app we don't use  quarkus-smallrye-openapi and use the following code instead and with that approach JsonView works just as you described.

OpenApiContext ctx = new JaxrsOpenApiContextBuilder<>()
.application(app)
.configLocation(configLocation)
.buildContext(true);
openAPI = ctx.read();

(However with the above code approach it does not work in dev mode just in normal runtime mode.)

-Dave

Reply all
Reply to author
Forward
0 new messages