It helps you to produce documentation that is accurate, concise, and well-structured. This documentation then allows your users to get the information they need with a minimum of fuss.
Template placeholders
[[resources-{{link}}]]
=== {{title}}
include::auto-method-path.adoc[]
include::auto-description.adoc[]
{{#sections}}
==== {{header}}
{{#filenames}}
include::{{.}}.adoc[]
{{/filenames}}
{{/sections}}
Template itself
include::{snippets}/your-endpoint/auto-section.adoc[]
Asciidoc
The section snippet combines most common snippets into one convenient file. It helps you being even more lazy, because a single line of AsciiDoc is sufficient to document one endpoint. Assuming of course that you already documented your code with Javadoc.
Configuration
Configuration
failOnUndocumentedFields - if build should fail on at least one undocumented field
responseBodyAsType - specified class should be considered as response type instead of endpoint method’s return type
Configuration
Configuration available during MockMvc setup:
failOnUndocumentedFields - if build should fail on at least one undocumented field
responseBodyAsType - specified class should be considered as response type instead of endpoint method’s return type
Result
@GetMapping("{id}")
public ItemResponse getItem(@PathVariable String id) { ... }
static class ItemResponse {
/**
* Unique item ID.
*/
@NotBlank
private String id;
/**
* Item's order number.
*/
@Min(1)
private Integer orderNumber;
}
Code
Response fields snippetResponse fields snippet automatically lists all fields of the response class, determined from return value of Controller’s method. List includes name, type, whether the field is optional, and its Javadoc with constraints.
Response fields snippet
Response fields snippet
Response fields snippet automatically lists all fields of the response class, determined from return value of Controller’s method. List includes name, type, whether the field is optional, and its Javadoc with constraints.
Response fields snippet