public abstract class PayloadDocumentation extends Object
Modifier and Type | Method and Description |
---|---|
static List<FieldDescriptor> |
applyPathPrefix(String pathPrefix,
List<FieldDescriptor> descriptors)
Creates a copy of the given
descriptors with the given pathPrefix
applied to their paths. |
static PayloadSubsectionExtractor<?> |
beneathPath(String path)
Returns a
PayloadSubsectionExtractor that will extract the subsection of
the JSON payload found beneath the given path . |
static FieldDescriptor |
fieldWithPath(String path)
Creates a
FieldDescriptor that describes a field with the given
path . |
static RequestFieldsSnippet |
relaxedRequestFields(FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operations's
request payload. |
static RequestFieldsSnippet |
relaxedRequestFields(List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operations's
request payload. |
static RequestFieldsSnippet |
relaxedRequestFields(Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operation's
request payload. |
static RequestFieldsSnippet |
relaxedRequestFields(Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operation's
request payload. |
static RequestFieldsSnippet |
relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the subsection of the
API operations's request payload extracted by the given subsectionExtractor
. |
static RequestFieldsSnippet |
relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the subsection of the
API operations's request payload extracted by the given subsectionExtractor
. |
static RequestFieldsSnippet |
relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor . |
static RequestFieldsSnippet |
relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor . |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static RequestPartFieldsSnippet |
relaxedRequestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static ResponseFieldsSnippet |
relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static RequestBodySnippet |
requestBody()
Returns a
Snippet that will document the body of the API operation's
request payload. |
static RequestBodySnippet |
requestBody(Map<String,Object> attributes)
Returns a
Snippet that will document the body of the API operation's
request payload. |
static RequestBodySnippet |
requestBody(PayloadSubsectionExtractor<?> subsectionExtractor)
Returns a
Snippet that will document a subsection of the body of the API
operation's request payload. |
static RequestBodySnippet |
requestBody(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes)
Returns a
Snippet that will document a subsection of the body of the API
operation's request payload. |
static RequestFieldsSnippet |
requestFields(FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operations's
request payload. |
static RequestFieldsSnippet |
requestFields(List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operations's
request payload. |
static RequestFieldsSnippet |
requestFields(Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operation's
request payload. |
static RequestFieldsSnippet |
requestFields(Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operation's
request payload. |
static RequestFieldsSnippet |
requestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the subsection of API
operations's request payload extracted by the given subsectionExtractor . |
static RequestFieldsSnippet |
requestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields in the subsection of the
API operations's request payload extracted by the given subsectionExtractor
. |
static RequestFieldsSnippet |
requestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor . |
static RequestFieldsSnippet |
requestFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor . |
static RequestPartBodySnippet |
requestPartBody(String partName)
Returns a
Snippet that will document the body of specified part of the API
operation's request payload. |
static RequestPartBodySnippet |
requestPartBody(String partName,
Map<String,Object> attributes)
Returns a
Snippet that will document the body of specified part of the API
operation's request payload. |
static RequestPartBodySnippet |
requestPartBody(String partName,
PayloadSubsectionExtractor<?> subsectionExtractor)
Returns a
Snippet that will document a subsection of the body of specified
part of the API operation's request payload. |
static RequestPartBodySnippet |
requestPartBody(String partName,
PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes)
Returns a
Snippet that will document a subsection of the body of specified
part of the API operation's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the specified
part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static RequestPartFieldsSnippet |
requestPartFields(String part,
PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the
specified part of the API operations's request payload. |
static ResponseBodySnippet |
responseBody()
Returns a
Snippet that will document the body of the API operation's
response payload. |
static ResponseBodySnippet |
responseBody(Map<String,Object> attributes)
Returns a
Snippet that will document the body of the API operation's
response payload. |
static ResponseBodySnippet |
responseBody(PayloadSubsectionExtractor<?> subsectionExtractor)
Returns a
Snippet that will document a subsection of the body of the API
operation's response payload. |
static ResponseBodySnippet |
responseBody(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes)
Returns a
Snippet that will document a subsection of the body of the API
operation's response payload. |
static ResponseFieldsSnippet |
responseFields(FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
responseFields(List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
responseFields(Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
responseFields(Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of the API operation's
response payload. |
static ResponseFieldsSnippet |
responseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static ResponseFieldsSnippet |
responseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static ResponseFieldsSnippet |
responseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
FieldDescriptor... descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static ResponseFieldsSnippet |
responseFields(PayloadSubsectionExtractor<?> subsectionExtractor,
Map<String,Object> attributes,
List<FieldDescriptor> descriptors)
Returns a
Snippet that will document the fields of a subsection of the API
operation's response payload. |
static SubsectionDescriptor |
subsectionWithPath(String path)
Creates a
FieldDescriptor that describes a subsection, i.e. |
public static FieldDescriptor fieldWithPath(String path)
FieldDescriptor
that describes a field with the given
path
.
When documenting an XML payload, the path
uses XPath, i.e. '/' is used to
descend to a child node.
When documenting a JSON payload, the path
uses '.' to descend into a child
object and ' []
' to descend into an array. For example, with this JSON
payload:
{ "a":{ "b":[ { "c":"one" }, { "c":"two" }, { "d":"three" } ] } }The following paths are all present:
Path | Value |
---|---|
a |
An object containing "b" |
a.b |
An array containing three objects |
a.b[] |
An array containing three objects |
a.b[].c |
An array containing the strings "one" and "two" |
a.b[].d |
The string "three" |
path
- The path of the fieldFieldDescriptor
ready for further configurationpublic static SubsectionDescriptor subsectionWithPath(String path)
FieldDescriptor
that describes a subsection, i.e. a field and all
of its descendants, with the given path
.
When documenting an XML payload, the path
uses XPath, i.e. '/' is used to
descend to a child node.
When documenting a JSON payload, the path
uses '.' to descend into a child
object and ' []
' to descend into an array. For example, with this JSON
payload:
{ "a":{ "b":[ { "c":"one" }, { "c":"two" }, { "d":"three" } ] } }The following paths are all present:
Path | Value |
---|---|
a |
An object containing "b" |
a.b |
An array containing three objects |
a.b[] |
An array containing three objects |
a.b[].c |
An array containing the strings "one" and "two" |
a.b[].d |
The string "three" |
A subsection descriptor for the array with the path a.b[]
will also
describe its descendants a.b[].c
and a.b[].d
.
path
- The path of the subsectionSubsectionDescriptor
ready for further configurationpublic static RequestFieldsSnippet requestFields(FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operations's
request payload. The fields will be documented using the given descriptors
.
If a field is present in the request payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the request,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
descriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
AbstractDescriptor.description(Object)
public static RequestFieldsSnippet requestFields(List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operations's
request payload. The fields will be documented using the given descriptors
.
If a field is present in the request payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the request,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
descriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet relaxedRequestFields(FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operations's
request payload. The fields will be documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
descriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet relaxedRequestFields(List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operations's
request payload. The fields will be documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
descriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet requestFields(Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operation's
request payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is present in the request payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the request,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
attributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet requestFields(Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operation's
request payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is present in the request payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the request,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
attributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet relaxedRequestFields(Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operation's
request payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
attributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet relaxedRequestFields(Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operation's
request payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
attributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestFieldsSnippet requestFields(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors)
Snippet
that will document the fields of the subsection of API
operations's request payload extracted by the given subsectionExtractor
.
The fields will be documented using the given descriptors
.
If a field is present in the subsection of the request payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur.For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet requestFields(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
Snippet
that will document the fields in the subsection of the
API operations's request payload extracted by the given subsectionExtractor
. The fields will be documented using the given descriptors
.
If a field is present in the subsection of the request payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors)
Snippet
that will document the fields of the subsection of the
API operations's request payload extracted by the given subsectionExtractor
. The fields will be documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the subsection of the
API operations's request payload extracted by the given subsectionExtractor
. The fields will be documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet requestFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor
.
The fields will be documented using the given descriptors
and the given
attributes
will be available during snippet generation.
If a field is present in the subsection of the request payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet requestFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor
.
The fields will be documented using the given descriptors
and the given
attributes
will be available during snippet generation.
If a field is present in the subsection of the request payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor
.
The fields will be documented using the given descriptors
and the given
attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestFieldsSnippet relaxedRequestFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the subsection of the
API operation's request payload extracted by the given subsectionExtractor
.
The fields will be documented using the given descriptors
and the given
attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, FieldDescriptor... descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
.
If a field is present in the payload of the request part, but is not documented by
one of the descriptors, a failure will occur when the snippet is invoked.
Similarly, if a field is documented, is not marked as optional, and is not present
in the request part's payload, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part namedescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
.
If a field is present in the payload of the request part, but is not documented by
one of the descriptors, a failure will occur when the snippet is invoked.
Similarly, if a field is documented, is not marked as optional, and is not present
in the request part's payload, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part namedescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, FieldDescriptor... descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part namedescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part namedescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
and the given attributes
will be
available during snippet generation.
If a field is present in the payload of the request part, but is not documented by
one of the descriptors, a failure will occur when the snippet is invoked.
Similarly, if a field is documented, is not marked as optional, and is not present
in the request part's payload, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
and the given attributes
will be
available during snippet generation.
If a field is present in the payload of the request part, but is not documented by
one of the descriptors, a failure will occur when the snippet is invoked.
Similarly, if a field is documented, is not marked as optional, and is not present
in the request part's payload, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
and the given attributes
will be
available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the specified
part
of the API operations's request payload. The fields will be documented
using the given descriptors
and the given attributes
will be
available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
.
If a field is present in the subsection of the request part payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the subsection's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
.
If a field is present in the subsection of the request part payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the subsection's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the givne subsectionExtractor
. The fields will be
documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is present in the subsection of the request part payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet requestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is present in the subsection of the request part payload, but is not
documented by one of the descriptors, a failure will occur when the snippet is
invoked. Similarly, if a field is documented, is not marked as optional, and is not
present in the subsection, a failure will also occur. For payloads with a
hierarchical structure, documenting a field with a
subsection descriptor
will mean that all of its
descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the
specified part
of the API operations's request payload. The subsection will
be extracted by the given subsectionExtractor
. The fields will be
documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet responseFields(FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
descriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static ResponseFieldsSnippet responseFields(List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
descriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
descriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
descriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static ResponseFieldsSnippet responseFields(Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
attributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static ResponseFieldsSnippet responseFields(Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response,
a failure will also occur. For payloads with a hierarchical structure, documenting
a field with a subsection descriptor
will mean
that all of its descendants are also treated as having been documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
attributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
attributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of the API operation's
response payload. The fields will be documented using the given descriptors
and the given attributes
will be available during snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
attributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
public static ResponseFieldsSnippet responseFields(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response
payload, a failure will also occur. For payloads with a hierarchical structure,
documenting a field with a subsection
descriptor
will mean that all of its descendants are also treated as having been
documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet responseFields(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response
payload, a failure will also occur. For payloads with a hierarchical structure,
documenting a field with a subsection
descriptor
will mean that all of its descendants are also treated as having been
documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet responseFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
and the given attributes
will be available during
snippet generation.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response
payload, a failure will also occur. For payloads with a hierarchical structure,
documenting a field with a subsection
descriptor
will mean that all of its descendants are also treated as having been
documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet responseFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
and the given attributes
will be available during
snippet generation.
If a field is present in the response payload, but is not documented by one of the
descriptors, a failure will occur when the snippet is invoked. Similarly, if a
field is documented, is not marked as optional, and is not present in the response
payload, a failure will also occur. For payloads with a hierarchical structure,
documenting a field with a subsection
descriptor
will mean that all of its descendants are also treated as having been
documented.
If you do not want to document a field or subsection, a descriptor can be
configured to ignore it
. The ignored field or
subsection will not appear in the generated snippet and the failure described above
will not occur.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, FieldDescriptor... descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
and the given attributes
will be available during
snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static ResponseFieldsSnippet relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes, List<FieldDescriptor> descriptors)
Snippet
that will document the fields of a subsection of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The fields will be documented using the given
descriptors
and the given attributes
will be available during
snippet generation.
If a field is documented, is not marked as optional, and is not present in the request, a failure will occur. Any undocumented fields will be ignored.
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fieldsfieldWithPath(String)
,
subsectionWithPath(String)
,
beneathPath(String)
public static RequestBodySnippet requestBody()
Snippet
that will document the body of the API operation's
request payload.public static RequestBodySnippet requestBody(Map<String,Object> attributes)
Snippet
that will document the body of the API operation's
request payload. The given attributes will be made available during snippet
generation.attributes
- the attributespublic static RequestBodySnippet requestBody(PayloadSubsectionExtractor<?> subsectionExtractor)
Snippet
that will document a subsection of the body of the API
operation's request payload. The subsection will be extracted using the given
subsectionExtractor
.subsectionExtractor
- the subsection extractorpublic static RequestBodySnippet requestBody(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes)
Snippet
that will document a subsection of the body of the API
operation's request payload. The subsection will be extracted using the given
subsectionExtractor
. The given attributes will be made available during
snippet generation.subsectionExtractor
- the subsection extractorattributes
- the attributespublic static ResponseBodySnippet responseBody()
Snippet
that will document the body of the API operation's
response payload.public static ResponseBodySnippet responseBody(Map<String,Object> attributes)
Snippet
that will document the body of the API operation's
response payload. The given attributes will be made available during snippet
generation.attributes
- the attributespublic static ResponseBodySnippet responseBody(PayloadSubsectionExtractor<?> subsectionExtractor)
Snippet
that will document a subsection of the body of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
.subsectionExtractor
- the subsection extractorpublic static ResponseBodySnippet responseBody(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes)
Snippet
that will document a subsection of the body of the API
operation's response payload. The subsection will be extracted using the given
subsectionExtractor
. The given attributes will be made available during
snippet generation.subsectionExtractor
- the subsection extractorattributes
- the attributespublic static RequestPartBodySnippet requestPartBody(String partName)
Snippet
that will document the body of specified part of the API
operation's request payload.partName
- the name of the request partpublic static RequestPartBodySnippet requestPartBody(String partName, Map<String,Object> attributes)
Snippet
that will document the body of specified part of the API
operation's request payload. The given attributes will be made available during
snippet generation.partName
- the name of the request partattributes
- the attributespublic static RequestPartBodySnippet requestPartBody(String partName, PayloadSubsectionExtractor<?> subsectionExtractor)
Snippet
that will document a subsection of the body of specified
part of the API operation's request payload. The subsection will be extracted using
the given subsectionExtractor
.partName
- the name of the request partsubsectionExtractor
- the subsection extractorpublic static RequestPartBodySnippet requestPartBody(String partName, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String,Object> attributes)
Snippet
that will document a subsection of the body of specified
part of the API operation's request payload. The subsection will be extracted using
the given subsectionExtractor
. The given attributes will be made available
during snippet generation.partName
- the name of the request partsubsectionExtractor
- the subsection extractorattributes
- the attributespublic static List<FieldDescriptor> applyPathPrefix(String pathPrefix, List<FieldDescriptor> descriptors)
descriptors
with the given pathPrefix
applied to their paths.pathPrefix
- the path prefixdescriptors
- the descriptors to copypublic static PayloadSubsectionExtractor<?> beneathPath(String path)
PayloadSubsectionExtractor
that will extract the subsection of
the JSON payload found beneath the given path
.path
- the path