microprofile openAPI generator

298 views
Skip to first unread message

Igor Berchtold

unread,
Aug 14, 2018, 10:48:49 AM8/14/18
to Eclipse MicroProfile

Hi,

I like to use OpenAPI v3 specification for describing my REST Services. Are there any plans to have a generator which does generate the stubs conforming to the microprofile openAPI annotations? 
At the moment I know that I can use the openAPI Tools Generator which does generate stubs but but using swagger package names. Is there the possibility to generate code so that microprofile package names will be used?

Everybody and all the samples are showing as start point the code, I would vote to have better support for code generation out of the yaml file.

Any thoughts on this?

best regards,

Igor

Arthur De Magalhaes

unread,
Aug 14, 2018, 5:04:35 PM8/14/18
to Eclipse MicroProfile
Hey Igor,

I definitely agree!   I think the right place for such contribution is indeed the OpenAPI Tool Generator repo (which spanned off from the Swagger gen repo).  

There's a current thread for the server-side generation: https://github.com/OpenAPITools/openapi-generator/issues/795

We should probably create an equivalent one for OAS3 -> MP Rest Client.

Thx,
Arthur

Emily Jiang

unread,
Aug 14, 2018, 5:12:54 PM8/14/18
to Eclipse MicroProfile
+1!

Emily

Igor Berchtold

unread,
Aug 15, 2018, 3:21:43 PM8/15/18
to Eclipse MicroProfile
Hi Arthur,

thank you for your response and the support. As I see in https://github.com/OpenAPITools/openapi-generator/pull/813 there is already work going on. So this means I can soon use my yaml OpenAPI v3 file and let generate the stubs with useSwagger=false for getting MP OpenAPI conferment stubs. So I do not need anymore any swagger Libraries for building my application and it can be microserver independent, correct?

best regards,

Igor

Arthur De Magalhaes

unread,
Aug 16, 2018, 4:28:50 PM8/16/18
to Eclipse MicroProfile
Hey Igor,

That's right - it will generate the JAXRS stubs for you based on the OAS3 input file. You just then have to include that OAS3 file with the app (see here) Please note though, that if you wanted the generation to also include MP OpenAPI annotations so that you can move from a design-first approach to a code-first approach (perhaps for the next version of the app), then you would have to wait for "stage 2" of https://github.com/OpenAPITools/openapi-generator/issues/795.  

Thanks,
Arthur
Reply all
Reply to author
Forward
0 new messages