public class RequestPartFieldsSnippet extends AbstractFieldsSnippet
Snippet that documents the fields in a request part.PayloadDocumentation.requestPartFields(String, FieldDescriptor...),
PayloadDocumentation.requestPartFields(String, List)| Modifier | Constructor and Description |
|---|---|
protected |
RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors)
Creates a new
RequestPartFieldsSnippet that will document the fields in the
request part using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors,
boolean ignoreUndocumentedFields)
Creates a new
RequestPartFieldsSnippet that will document the fields in the
request part using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
RequestFieldsSnippet that will document the fields in the
request using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedFields)
Creates a new
RequestFieldsSnippet that will document the fields in the
request using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors)
Creates a new
RequestPartFieldsSnippet that will document the fields in a
subsection of the request part using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors,
boolean ignoreUndocumentedFields)
Creates a new
RequestPartFieldsSnippet that will document the fields in a
subsection the request part using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates a new
RequestPartFieldsSnippet that will document the fields in a
subsection of the request part using the given descriptors. |
protected |
RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedFields)
Creates a new
RequestPartFieldsSnippet that will document the fields in a
subsection of the request part using the given descriptors. |
| Modifier and Type | Method and Description |
|---|---|
RequestPartFieldsSnippet |
and(FieldDescriptor... additionalDescriptors)
Returns a new
RequestPartFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors. |
RequestPartFieldsSnippet |
and(java.util.List<FieldDescriptor> additionalDescriptors)
Returns a new
RequestPartFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors. |
RequestPartFieldsSnippet |
andWithPrefix(java.lang.String pathPrefix,
FieldDescriptor... additionalDescriptors)
Returns a new
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors. |
RequestPartFieldsSnippet |
andWithPrefix(java.lang.String pathPrefix,
java.util.List<FieldDescriptor> additionalDescriptors)
Returns a new
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors. |
protected byte[] |
getContent(Operation operation)
Returns the content of the request or response extracted form the given
operation. |
protected org.springframework.http.MediaType |
getContentType(Operation operation)
Returns the content type of the request or response extracted from the given
operation. |
createModel, createModelForDescriptor, getFieldDescriptors, isIgnoredUndocumentedFieldsdocument, getAttributes, getSnippetNameprotected RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors)
RequestPartFieldsSnippet that will document the fields in the
request part using the given descriptors. Undocumented fields will trigger
a failure.partName - the part namedescriptors - the descriptorsprotected RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors,
boolean ignoreUndocumentedFields)
RequestPartFieldsSnippet that will document the fields in the
request part using the given descriptors. If
ignoreUndocumentedFields is true, undocumented fields will be
ignored and will not trigger a failure.partName - the part namedescriptors - the descriptorsignoreUndocumentedFields - whether undocumented fields should be ignoredprotected RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.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. Undocumented fields will trigger a
failure.partName - the part namedescriptors - the descriptorsattributes - the additional attributesprotected RequestPartFieldsSnippet(java.lang.String partName,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedFields)
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. If
ignoreUndocumentedFields is true, undocumented fields will be
ignored and will not trigger a failure.partName - the part namedescriptors - the descriptorsattributes - the additional attributesignoreUndocumentedFields - whether undocumented fields should be ignoredprotected RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors)
RequestPartFieldsSnippet that will document the fields in a
subsection of the request part using the given descriptors. The subsection
will be extracted using the given subsectionExtractor. Undocumented fields
will trigger a failure.partName - the part namesubsectionExtractor - the subsection extractordescriptors - the descriptorsprotected RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors,
boolean ignoreUndocumentedFields)
RequestPartFieldsSnippet that will document the fields in a
subsection the request part using the given descriptors. The subsection
will be extracted using the given subsectionExtractor. If
ignoreUndocumentedFields is true, undocumented fields will be
ignored and will not trigger a failure.partName - the part namesubsectionExtractor - the subsection extractordescriptors - the descriptorsignoreUndocumentedFields - whether undocumented fields should be ignoredprotected RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes)
RequestPartFieldsSnippet that will document the fields in a
subsection of the request part using the given descriptors. The subsection
will be extracted using the given subsectionExtractor. The given
attributes will be included in the model during template rendering.
Undocumented fields will trigger a failure.partName - the part namesubsectionExtractor - the subsection extractordescriptors - the descriptorsattributes - the additional attributesprotected RequestPartFieldsSnippet(java.lang.String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
java.util.List<FieldDescriptor> descriptors,
java.util.Map<java.lang.String,java.lang.Object> attributes,
boolean ignoreUndocumentedFields)
RequestPartFieldsSnippet that will document the fields in a
subsection of the request part using the given descriptors. The subsection
will be extracted using the given subsectionExtractor. The given
attributes will be included in the model during template rendering. If
ignoreUndocumentedFields is true, undocumented fields will be
ignored and will not trigger a failure.partName - the part namesubsectionExtractor - the subsection extractordescriptors - the descriptorsattributes - the additional attributesignoreUndocumentedFields - whether undocumented fields should be ignoredprotected org.springframework.http.MediaType getContentType(Operation operation)
AbstractFieldsSnippetoperation.getContentType in class AbstractFieldsSnippetoperation - The operationprotected byte[] getContent(Operation operation) throws java.io.IOException
AbstractFieldsSnippetoperation.getContent in class AbstractFieldsSnippetoperation - The operationjava.io.IOException - if the content cannot be extractedpublic final RequestPartFieldsSnippet and(FieldDescriptor... additionalDescriptors)
RequestPartFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors.additionalDescriptors - the additional descriptorspublic final RequestPartFieldsSnippet and(java.util.List<FieldDescriptor> additionalDescriptors)
RequestPartFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors.additionalDescriptors - the additional descriptorspublic final RequestPartFieldsSnippet andWithPrefix(java.lang.String pathPrefix, FieldDescriptor... additionalDescriptors)
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors. The given pathPrefix is applied to the path
of each additional descriptor.pathPrefix - the prefix to apply to the additional descriptorsadditionalDescriptors - the additional descriptorspublic final RequestPartFieldsSnippet andWithPrefix(java.lang.String pathPrefix, java.util.List<FieldDescriptor> additionalDescriptors)
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors. The given pathPrefix is applied to the path
of each additional descriptor.pathPrefix - the prefix to apply to the additional descriptorsadditionalDescriptors - the additional descriptors