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,
boolean ignoreUndocumentedFields)
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 . |
protected |
RequestFieldsSnippet(List<FieldDescriptor> descriptors,
Map<String,Object> attributes,
boolean ignoreUndocumentedFields)
Creates a new
RequestFieldsSnippet that will document the fields in the
request using the given descriptors . |
protected |
RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Creates a new
RequestFieldsSnippet that will document the fields in the
subsection of the request extracted by the given subsectionExtractor using
the given descriptors . |
protected |
RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors,
boolean ignoreUndocumentedFields)
Creates a new
RequestFieldsSnippet that will document the fields in the
subsection of the request extracted by the given subsectionExtractor using
the given descriptors . |
protected |
RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors,
Map<String,Object> attributes)
Creates a new
RequestFieldsSnippet that will document the fields in the
subsection of the request extracted by the given subsectionExtractor using
the given descriptors . |
protected |
RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors,
Map<String,Object> attributes,
boolean ignoreUndocumentedFields)
Creates a new
RequestFieldsSnippet that will document the fields in the
subsection of the request extracted by the given subsectionExtractor using
the given descriptors . |
Modifier and Type | Method and Description |
---|---|
RequestFieldsSnippet |
and(FieldDescriptor... additionalDescriptors)
Returns a new
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
RequestFieldsSnippet |
and(List<FieldDescriptor> additionalDescriptors)
Returns a new
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
RequestFieldsSnippet |
andWithPrefix(String pathPrefix,
FieldDescriptor... additionalDescriptors)
Returns a new
RequestFieldsSnippet configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors . |
RequestFieldsSnippet |
andWithPrefix(String pathPrefix,
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, isIgnoredUndocumentedFields
document, getAttributes, getSnippetName
protected RequestFieldsSnippet(List<FieldDescriptor> descriptors)
RequestFieldsSnippet
that will document the fields in the
request using the given descriptors
. Undocumented fields will trigger a
failure.descriptors
- the descriptorsprotected RequestFieldsSnippet(List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields)
RequestFieldsSnippet
that will document the fields in the
request using the given descriptors
. If ignoreUndocumentedFields
is
true
, undocumented fields will be ignored and will not trigger a failure.descriptors
- the descriptorsignoreUndocumentedFields
- whether undocumented fields should be ignoredprotected 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. Undocumented fields will trigger a
failure.descriptors
- the descriptorsattributes
- the additional attributesprotected RequestFieldsSnippet(List<FieldDescriptor> descriptors, Map<String,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.descriptors
- the descriptorsattributes
- the additional attributesignoreUndocumentedFields
- whether undocumented fields should be ignoredprotected RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
RequestFieldsSnippet
that will document the fields in the
subsection of the request extracted by the given subsectionExtractor
using
the given descriptors
. Undocumented fields will trigger a failure.subsectionExtractor
- the subsection extractordescriptors
- the descriptorsprotected RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields)
RequestFieldsSnippet
that will document the fields in the
subsection of the request extracted by the given subsectionExtractor
using
the given descriptors
. If ignoreUndocumentedFields
is true
,
undocumented fields will be ignored and will not trigger a failure.subsectionExtractor
- the subsection extractor documentdescriptors
- the descriptorsignoreUndocumentedFields
- whether undocumented fields should be ignoredprotected RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String,Object> attributes)
RequestFieldsSnippet
that will document the fields in the
subsection of the request extracted by the given subsectionExtractor
using
the given descriptors
. The given attributes
will be included in the
model during template rendering. Undocumented fields will trigger a failure.subsectionExtractor
- the subsection extractordescriptors
- the descriptorsattributes
- the additional attributesprotected RequestFieldsSnippet(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String,Object> attributes, boolean ignoreUndocumentedFields)
RequestFieldsSnippet
that will document the fields in the
subsection of the request extracted by the given subsectionExtractor
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.subsectionExtractor
- the path identifying the subsection of the payload to
documentdescriptors
- the descriptorsattributes
- the additional attributesignoreUndocumentedFields
- whether undocumented fields should be ignoredprotected org.springframework.http.MediaType getContentType(Operation operation)
AbstractFieldsSnippet
operation
.getContentType
in class AbstractFieldsSnippet
operation
- The operationprotected byte[] getContent(Operation operation) throws IOException
AbstractFieldsSnippet
operation
.getContent
in class AbstractFieldsSnippet
operation
- The operationIOException
- if the content cannot be extractedpublic final RequestFieldsSnippet and(FieldDescriptor... additionalDescriptors)
RequestFieldsSnippet
configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors
.additionalDescriptors
- the additional descriptorspublic final RequestFieldsSnippet and(List<FieldDescriptor> additionalDescriptors)
RequestFieldsSnippet
configured with this snippet's
attributes and its descriptors combined with the given
additionalDescriptors
.additionalDescriptors
- the additional descriptorspublic final RequestFieldsSnippet andWithPrefix(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 RequestFieldsSnippet andWithPrefix(String pathPrefix, 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