I'm trying do document my Spring Data REST API with OpenAPI with spring-doc.
I have my custom endpoints with my custom comments and examples, works fine.
But what about the generated endpoints?
For example for my entity 'host' most endpoints are generated, GET /hosts, PUT /hosts, GET /hosts{id} etc.
Only POST and DELETE I have overridden for some special needs, here I added @Operation annotation etc.
I want to add examples for the responses of the GET-requests to illustrate the custom fields in the _links section of hateos result object. (See here: https://github.com/springdoc/springdoc-openapi/issues/237)
But when there is no code, where do I do this?
Thank you.
Juliane
I fixed this for me with a customized OpenApi object.
https://springdoc.org/v1/#how-can-i-customise-the-openapi-object
or for springdoc-openapi v2
https://springdoc.org/#how-can-i-customise-the-openapi-object
Maybe there's a better more correct way to do this. But for now, it works for me.