public class RequestFieldsSnippet extends AbstractFieldsSnippet
Snippet that documents the fields in a request.PayloadDocumentation.requestFields(FieldDescriptor...),
PayloadDocumentation.requestFields(Map, FieldDescriptor...)| Modifier | Constructor and Description |
|---|---|
protected |
RequestFieldsSnippet(List<FieldDescriptor> descriptors)
Creates a new
RequestFieldsSnippet that will document the fields in the
request using the given descriptors. |
protected |
RequestFieldsSnippet(List<FieldDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
RequestFieldsSnippet that will document the fields in the
request using the given descriptors. |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
getContent(Operation operation)
Returns the content of the request or response extracted form the given
operation. |
protected MediaType |
getContentType(Operation operation)
Returns the content type of the request or response extracted from the given
operation. |
createModel, createModelForDescriptor, getFieldDescriptorsdocument, getAttributes, getSnippetNameprotected RequestFieldsSnippet(List<FieldDescriptor> descriptors)
RequestFieldsSnippet that will document the fields in the
request using the given descriptors.descriptors - the descriptorsprotected RequestFieldsSnippet(List<FieldDescriptor> descriptors, Map<String,Object> attributes)
RequestFieldsSnippet that will document the fields in the
request using the given descriptors. The given attributes will be
included in the model during template rendering.descriptors - the descriptorsattributes - the additional attributesprotected MediaType getContentType(Operation operation)
AbstractFieldsSnippetoperation.getContentType in class AbstractFieldsSnippetoperation - The operationprotected byte[] getContent(Operation operation) throws IOException
AbstractFieldsSnippetoperation.getContent in class AbstractFieldsSnippetoperation - The operationIOException - if the content cannot be extracted