Is it possible to use annotations (at field-level) to provide description for fields?
I know I can use description
method for that
.andDo(document("index", responseFields(
fieldWithPath("contact").description("The user's contact details"),
but I would prefer to put that description together with field definition, in my response object.
class IndexResponse {
//The user's contact details
String contract;
}
I know that I could have generated constraint descriptions (http://docs.spring.io/spring-restdocs/docs/current/reference/html5/#_using_constraint_descriptions_in_generated_snippets) but it generated description only for validation annotations.
I am looking for something like https://github.com/swagger-api/swagger-core/wiki/Annotations#apimodelproperty from Swagger.