Class PayloadDocumentation
- Author:
- Andreas Evers, Andy Wilkinson, Marcel Overdijk
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<FieldDescriptor>
applyPathPrefix
(String pathPrefix, List<FieldDescriptor> descriptors) Creates a copy of the givendescriptors
with the givenpathPrefix
applied to their paths.static PayloadSubsectionExtractor<?>
beneathPath
(String path) Returns aPayloadSubsectionExtractor
that will extract the subsection of the JSON payload found beneath the givenpath
.static FieldDescriptor
fieldWithPath
(String path) Creates aFieldDescriptor
that describes a field with the givenpath
.static RequestFieldsSnippet
relaxedRequestFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
relaxedRequestFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
relaxedRequestFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
relaxedRequestFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
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
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 RequestFieldsSnippet
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
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
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
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
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
relaxedRequestPartFields
(String part, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
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
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 RequestPartFieldsSnippet
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
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
relaxedResponseFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
relaxedResponseFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
relaxedResponseFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
relaxedResponseFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
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
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 ResponseFieldsSnippet
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
relaxedResponseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static RequestBodySnippet
Returns aSnippet
that will document the body of the API operation's request payload.static RequestBodySnippet
requestBody
(Map<String, Object> attributes) Returns aSnippet
that will document the body of the API operation's request payload.static RequestBodySnippet
requestBody
(PayloadSubsectionExtractor<?> subsectionExtractor) Returns aSnippet
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 aSnippet
that will document a subsection of the body of the API operation's request payload.static RequestFieldsSnippet
requestFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
requestFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
requestFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's request payload.static RequestFieldsSnippet
requestFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operations's request payload.static RequestFieldsSnippet
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
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 RequestFieldsSnippet
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
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 RequestPartBodySnippet
requestPartBody
(String partName) Returns aSnippet
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 aSnippet
that will document the body of specified part of the API operation's request payload.static RequestPartBodySnippet
requestPartBody
(String partName, PayloadSubsectionExtractor<?> subsectionExtractor) Returns aSnippet
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 aSnippet
that will document a subsection of the body of specified part of the API operation's request payload.static RequestPartFieldsSnippet
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
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
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
requestPartFields
(String part, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload.static RequestPartFieldsSnippet
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
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 RequestPartFieldsSnippet
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
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.static ResponseBodySnippet
Returns aSnippet
that will document the body of the API operation's response payload.static ResponseBodySnippet
responseBody
(Map<String, Object> attributes) Returns aSnippet
that will document the body of the API operation's response payload.static ResponseBodySnippet
responseBody
(PayloadSubsectionExtractor<?> subsectionExtractor) Returns aSnippet
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 aSnippet
that will document a subsection of the body of the API operation's response payload.static ResponseFieldsSnippet
responseFields
(List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
responseFields
(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
responseFields
(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
responseFields
(FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload.static ResponseFieldsSnippet
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
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.static ResponseFieldsSnippet
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
responseFields
(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload.static SubsectionDescriptor
subsectionWithPath
(String path) Creates aFieldDescriptor
that describes a subsection, i.e.
-
Method Details
-
fieldWithPath
Creates aFieldDescriptor
that describes a field with the givenpath
.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:Paths that are present and their values 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" - Parameters:
path
- the path of the field- Returns:
- a
FieldDescriptor
ready for further configuration
-
subsectionWithPath
Creates aFieldDescriptor
that describes a subsection, i.e. a field and all of its descendants, with the givenpath
.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:Paths that are present and their values 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 descendantsa.b[].c
anda.b[].d
.- Parameters:
path
- the path of the subsection- Returns:
- a
SubsectionDescriptor
ready for further configuration
-
requestFields
Returns aSnippet
that will document the fields of the API operations's request payload. The fields will be documented using the givendescriptors
.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.- Parameters:
descriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestFields
Returns aSnippet
that will document the fields of the API operations's request payload. The fields will be documented using the givendescriptors
.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.- Parameters:
descriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestFields
Returns aSnippet
that will document the fields of the API operations's request payload. The fields will be documented using the givendescriptors
.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.
- Parameters:
descriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestFields
Returns aSnippet
that will document the fields of the API operations's request payload. The fields will be documented using the givendescriptors
.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.
- Parameters:
descriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestFields
public static RequestFieldsSnippet requestFields(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's request payload. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestFields
public static RequestFieldsSnippet requestFields(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's request payload. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestFields
public static RequestFieldsSnippet relaxedRequestFields(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's request payload. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestFields
public static RequestFieldsSnippet relaxedRequestFields(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's request payload. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
.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.- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
.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.- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
.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.
- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
.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.
- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestFields
public static RequestFieldsSnippet 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
. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet requestPartFields(String part, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload. The fields will be documented using the givendescriptors
.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.- Parameters:
part
- the part namedescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet requestPartFields(String part, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload. The fields will be documented using the givendescriptors
.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.- Parameters:
part
- the part namedescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload. The fields will be documented using the givendescriptors
.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.
- Parameters:
part
- the part namedescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet relaxedRequestPartFields(String part, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the specifiedpart
of the API operations's request payload. The fields will be documented using the givendescriptors
.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.
- Parameters:
part
- the part namedescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet 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. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet 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. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet 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. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet 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. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
part
- the part nameattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the subsection's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the subsection's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.
- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.
- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractordescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givnesubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedRequestPartFields
public static RequestPartFieldsSnippet 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. The subsection will be extracted by the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
part
- the part namesubsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the request part's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
responseFields
Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
.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.- Parameters:
descriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
responseFields
Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
.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.- Parameters:
descriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedResponseFields
Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
.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.
- Parameters:
descriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedResponseFields
Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
.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.
- Parameters:
descriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
responseFields
public static ResponseFieldsSnippet responseFields(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
responseFields
public static ResponseFieldsSnippet responseFields(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedResponseFields
public static ResponseFieldsSnippet relaxedResponseFields(Map<String, Object> attributes, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
relaxedResponseFields
public static ResponseFieldsSnippet relaxedResponseFields(Map<String, Object> attributes, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of the API operation's response payload. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
attributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- See Also:
-
responseFields
public static ResponseFieldsSnippet responseFields(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
responseFields
public static ResponseFieldsSnippet responseFields(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedResponseFields
public static ResponseFieldsSnippet relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor, FieldDescriptor... descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.
- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedResponseFields
public static ResponseFieldsSnippet relaxedResponseFields(PayloadSubsectionExtractor<?> subsectionExtractor, List<FieldDescriptor> descriptors) Returns aSnippet
that will document the fields of a subsection of the API operation's response payload. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
.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.
- Parameters:
subsectionExtractor
- the subsection extractordescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
responseFields
public static ResponseFieldsSnippet 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. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
responseFields
public static ResponseFieldsSnippet 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. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedResponseFields
public static ResponseFieldsSnippet 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. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
relaxedResponseFields
public static ResponseFieldsSnippet 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. The subsection will be extracted using the givensubsectionExtractor
. The fields will be documented using the givendescriptors
and the givenattributes
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.
- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributesdescriptors
- the descriptions of the response payload's fields- Returns:
- the snippet that will document the fields
- Since:
- 1.2.0
- See Also:
-
requestBody
Returns aSnippet
that will document the body of the API operation's request payload.- Returns:
- the snippet that will document the request body
-
requestBody
Returns aSnippet
that will document the body of the API operation's request payload. The given attributes will be made available during snippet generation.- Parameters:
attributes
- the attributes- Returns:
- the snippet that will document the request body
-
requestBody
Returns aSnippet
that will document a subsection of the body of the API operation's request payload. The subsection will be extracted using the givensubsectionExtractor
.- Parameters:
subsectionExtractor
- the subsection extractor- Returns:
- the snippet that will document the request body subsection
-
requestBody
public static RequestBodySnippet requestBody(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes) Returns aSnippet
that will document a subsection of the body of the API operation's request payload. The subsection will be extracted using the givensubsectionExtractor
. The given attributes will be made available during snippet generation.- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributes- Returns:
- the snippet that will document the request body subsection
-
responseBody
Returns aSnippet
that will document the body of the API operation's response payload.- Returns:
- the snippet that will document the response body
-
responseBody
Returns aSnippet
that will document the body of the API operation's response payload. The given attributes will be made available during snippet generation.- Parameters:
attributes
- the attributes- Returns:
- the snippet that will document the response body
-
responseBody
Returns aSnippet
that will document a subsection of the body of the API operation's response payload. The subsection will be extracted using the givensubsectionExtractor
.- Parameters:
subsectionExtractor
- the subsection extractor- Returns:
- the snippet that will document the response body subsection
-
responseBody
public static ResponseBodySnippet responseBody(PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes) Returns aSnippet
that will document a subsection of the body of the API operation's response payload. The subsection will be extracted using the givensubsectionExtractor
. The given attributes will be made available during snippet generation.- Parameters:
subsectionExtractor
- the subsection extractorattributes
- the attributes- Returns:
- the snippet that will document the response body subsection
-
requestPartBody
Returns aSnippet
that will document the body of specified part of the API operation's request payload.- Parameters:
partName
- the name of the request part- Returns:
- the snippet that will document the response body
-
requestPartBody
public static RequestPartBodySnippet requestPartBody(String partName, Map<String, Object> attributes) Returns aSnippet
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.- Parameters:
partName
- the name of the request partattributes
- the attributes- Returns:
- the snippet that will document the response body
-
requestPartBody
public static RequestPartBodySnippet requestPartBody(String partName, PayloadSubsectionExtractor<?> subsectionExtractor) Returns aSnippet
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 givensubsectionExtractor
.- Parameters:
partName
- the name of the request partsubsectionExtractor
- the subsection extractor- Returns:
- the snippet that will document the response body
-
requestPartBody
public static RequestPartBodySnippet requestPartBody(String partName, PayloadSubsectionExtractor<?> subsectionExtractor, Map<String, Object> attributes) Returns aSnippet
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 givensubsectionExtractor
. The given attributes will be made available during snippet generation.- Parameters:
partName
- the name of the request partsubsectionExtractor
- the subsection extractorattributes
- the attributes- Returns:
- the snippet that will document the response body
-
applyPathPrefix
public static List<FieldDescriptor> applyPathPrefix(String pathPrefix, List<FieldDescriptor> descriptors) Creates a copy of the givendescriptors
with the givenpathPrefix
applied to their paths.- Parameters:
pathPrefix
- the path prefixdescriptors
- the descriptors to copy- Returns:
- the copied descriptors with the prefix applied
-
beneathPath
Returns aPayloadSubsectionExtractor
that will extract the subsection of the JSON payload found beneath the givenpath
.- Parameters:
path
- the path- Returns:
- the subsection extractor
- Since:
- 1.2.0
-