Skip to content

Looking for Java Swagger annotation example that produces proper mocks when imported into microck. #807

Answered by lbroudoux
gsrunion asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @gsrunion

Unfortunately no : we have no sample on how to generate Swagger or OpenAPI contract from annotated Java file. I suspect some users in the community are doing this but mostly as a bootstrap method for getting contract they will later complement with examples and extend.

I suspect that if you want a comprehensive schema that directly worked with Microcks OOTB, you'll have to annotate your Java code with @ExampleObject for both request body and responses (see https://javadoc.io/doc/io.swagger.core.v3/swagger-annotations/latest/io/swagger/v3/oas/annotations/media/ExampleObject.html).

Please let us know and share your findings!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lbroudoux
Comment options

Answer selected by lbroudoux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants