Uses of Class
org.springframework.restdocs.payload.FieldDescriptor
Package
Description
Documenting the payload of a RESTful API's requests and responses.
-
Uses of FieldDescriptor in org.springframework.restdocs.payload
Modifier and TypeMethodDescriptionstatic FieldDescriptor
PayloadDocumentation.fieldWithPath
(String path) Creates aFieldDescriptor
that describes a field with the givenpath
.final FieldDescriptor
FieldDescriptor.optional()
Marks the field as optional.final FieldDescriptor
Specifies the type of the field.Modifier and TypeMethodDescriptionstatic List<FieldDescriptor>
PayloadDocumentation.applyPathPrefix
(String pathPrefix, List<FieldDescriptor> descriptors) Creates a copy of the givendescriptors
with the givenpathPrefix
applied to their paths.protected final List<FieldDescriptor>
AbstractFieldsSnippet.getFieldDescriptors()
Returns the list ofFieldDescriptors
that will be used to generate the documentation.Modifier and TypeMethodDescriptionfinal RequestFieldsSnippet
RequestFieldsSnippet.and
(FieldDescriptor... additionalDescriptors) Returns a newRequestFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestPartFieldsSnippet
RequestPartFieldsSnippet.and
(FieldDescriptor... additionalDescriptors) Returns a newRequestPartFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final ResponseFieldsSnippet
ResponseFieldsSnippet.and
(FieldDescriptor... additionalDescriptors) Returns a newResponseFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestFieldsSnippet
RequestFieldsSnippet.andWithPrefix
(String pathPrefix, FieldDescriptor... additionalDescriptors) Returns a newRequestFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestPartFieldsSnippet
RequestPartFieldsSnippet.andWithPrefix
(String pathPrefix, FieldDescriptor... additionalDescriptors) Returns a newRequestFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final ResponseFieldsSnippet
ResponseFieldsSnippet.andWithPrefix
(String pathPrefix, FieldDescriptor... additionalDescriptors) Returns a newResponseFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.AbstractFieldsSnippet.createModelForDescriptor
(FieldDescriptor descriptor) Returns a model for the givendescriptor
.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the subsection of the API operation's request payload extracted by the givensubsectionExtractor
.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the subsection of the API operations's request payload extracted by the givensubsectionExtractor
.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the subsection of the API operation's request payload extracted by the givensubsectionExtractor
.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the subsection of API operations's request payload extracted by the givensubsectionExtractor
.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.FieldTypeResolver.resolveFieldType
(FieldDescriptor fieldDescriptor) Resolves the type of the field that is described by the givenfieldDescriptor
based on the content of the payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.Modifier and TypeMethodDescriptionfinal RequestFieldsSnippet
RequestFieldsSnippet.and
(List<FieldDescriptor> additionalDescriptors) Returns a newRequestFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestPartFieldsSnippet
RequestPartFieldsSnippet.and
(List<FieldDescriptor> additionalDescriptors) Returns a newRequestPartFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final ResponseFieldsSnippet
ResponseFieldsSnippet.and
(List<FieldDescriptor> additionalDescriptors) Returns a newResponseFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestFieldsSnippet
RequestFieldsSnippet.andWithPrefix
(String pathPrefix, List<FieldDescriptor> additionalDescriptors) Returns a newRequestFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestPartFieldsSnippet
RequestPartFieldsSnippet.andWithPrefix
(String pathPrefix, List<FieldDescriptor> additionalDescriptors) Returns a newRequestFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final ResponseFieldsSnippet
ResponseFieldsSnippet.andWithPrefix
(String pathPrefix, List<FieldDescriptor> additionalDescriptors) Returns a newResponseFieldsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.static List<FieldDescriptor>
PayloadDocumentation.applyPathPrefix
(String pathPrefix, List<FieldDescriptor> descriptors) Creates a copy of the givendescriptors
with the givenpathPrefix
applied to their paths.byte[]
FieldPathPayloadSubsectionExtractor.extractSubsection
(byte[] payload, org.springframework.http.MediaType contentType, List<FieldDescriptor> descriptors) default byte[]
PayloadSubsectionExtractor.extractSubsection
(byte[] payload, org.springframework.http.MediaType contentType, List<FieldDescriptor> descriptors) Extracts a subsection of the givenpayload
that has the givencontentType
and that is described by the givendescriptors
.static FieldTypeResolver
FieldTypeResolver.forContentWithDescriptors
(byte[] content, org.springframework.http.MediaType contentType, List<FieldDescriptor> descriptors) Create aFieldTypeResolver
for the givencontent
andcontentType
, described by the givendescriptors
.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the subsection of the API operations's request payload extracted by the givensubsectionExtractor
.static RequestFieldsSnippet
PayloadDocumentation.relaxedRequestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the subsection of the API operation's request payload extracted by the givensubsectionExtractor
.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.relaxedRequestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.relaxedResponseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields in the subsection of the API operations's request payload extracted by the givensubsectionExtractor
.static RequestFieldsSnippet
PayloadDocumentation.requestFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the subsection of the API operation's request payload extracted by the givensubsectionExtractor
.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
PayloadDocumentation.requestPartFields
(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the specifiedpart
of the API operations's request payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static ResponseFieldsSnippet
PayloadDocumentation.responseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.ModifierConstructorDescriptionprotected
AbstractFieldsSnippet
(String name, String type, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newAbstractFieldsSnippet
that will produce a snippet named<name>-fields
using a template named<type>-fields
.protected
AbstractFieldsSnippet
(String name, String type, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields, PayloadSubsectionExtractor<?> subsectionExtractor) Creates a newAbstractFieldsSnippet
that will produce a snippet named<name>-fields
using a template named<type>-fields
.protected
AbstractFieldsSnippet
(String type, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newAbstractFieldsSnippet
that will produce a snippet named<type>-fields
using a template named<type>-fields
.protected
AbstractFieldsSnippet
(String type, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields, PayloadSubsectionExtractor<?> subsectionExtractor) Creates a newAbstractFieldsSnippet
that will produce a snippet named<type>-fields
using a template named<type>-fields
.protected
RequestFieldsSnippet
(List<FieldDescriptor> descriptors) Creates a newRequestFieldsSnippet
that will document the fields in the request using the givendescriptors
.protected
RequestFieldsSnippet
(List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields) Creates a newRequestFieldsSnippet
that will document the fields in the request using the givendescriptors
.protected
RequestFieldsSnippet
(List<FieldDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestFieldsSnippet
that will document the fields in the request using the givendescriptors
.protected
RequestFieldsSnippet
(List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newRequestFieldsSnippet
that will document the fields in the request using the givendescriptors
.protected
RequestFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Creates a newRequestFieldsSnippet
that will document the fields in the subsection of the request extracted by the givensubsectionExtractor
using the givendescriptors
.protected
RequestFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields) Creates a newRequestFieldsSnippet
that will document the fields in the subsection of the request extracted by the givensubsectionExtractor
using the givendescriptors
.protected
RequestFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestFieldsSnippet
that will document the fields in the subsection of the request extracted by the givensubsectionExtractor
using the givendescriptors
.protected
RequestFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newRequestFieldsSnippet
that will document the fields in the subsection of the request extracted by the givensubsectionExtractor
using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, List<FieldDescriptor> descriptors) Creates a newRequestPartFieldsSnippet
that will document the fields in the request part using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields) Creates a newRequestPartFieldsSnippet
that will document the fields in the request part using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, List<FieldDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestFieldsSnippet
that will document the fields in the request using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newRequestFieldsSnippet
that will document the fields in the request using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Creates a newRequestPartFieldsSnippet
that will document the fields in a subsection of the request part using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields) Creates a newRequestPartFieldsSnippet
that will document the fields in a subsection the request part using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestPartFieldsSnippet
that will document the fields in a subsection of the request part using the givendescriptors
.protected
RequestPartFieldsSnippet
(String partName, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newRequestPartFieldsSnippet
that will document the fields in a subsection of the request part using the givendescriptors
.protected
ResponseFieldsSnippet
(List<FieldDescriptor> descriptors) Creates a newResponseFieldsSnippet
that will document the fields in the response using the givendescriptors
.protected
ResponseFieldsSnippet
(List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields) Creates a newResponseFieldsSnippet
that will document the fields in the response using the givendescriptors
.protected
ResponseFieldsSnippet
(List<FieldDescriptor> descriptors, Map<String, Object> attributes) Creates a newResponseFieldsSnippet
that will document the fields in the response using the givendescriptors
.protected
ResponseFieldsSnippet
(List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newResponseFieldsSnippet
that will document the fields in the response using the givendescriptors
.protected
ResponseFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Creates a newResponseFieldsSnippet
that will document the fields in a subsection of the response using the givendescriptors
.protected
ResponseFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, boolean ignoreUndocumentedFields) Creates a newResponseFieldsSnippet
that will document the fields in the subsection of the response using the givendescriptors
.protected
ResponseFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String, Object> attributes) Creates a newResponseFieldsSnippet
that will document the fields in a subsection of the response using the givendescriptors
.protected
ResponseFieldsSnippet
(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedFields) Creates a newResponseFieldsSnippet
that will document the fields in a subsection of the response using the givendescriptors
.