1

I have a POJO model that contains lots of fields. When we generate OpenApi Swagger docs for external users, we only want to expose a subset of the fields. Is there a way to do that? We don't want to change the POJO to add @ApiModelProperty for each field.

2
  • I don't know an easier way then to write it yourself, after javac is done, like this may be, but it will not be easy Commented May 5, 2021 at 18:40
  • have you considered facading the pojo's with boundary classes, exposing only the fields which are used in the request? Commented May 5, 2021 at 20:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.