Class RequestPartsSnippet
java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.request.RequestPartsSnippet
- All Implemented Interfaces:
Snippet
A
Snippet
that documents the request parts supported by a RESTful resource.- Since:
- 1.1.0
- Author:
- Andy Wilkinson
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
RequestPartsSnippet
(List<RequestPartDescriptor> descriptors) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
.protected
RequestPartsSnippet
(List<RequestPartDescriptor> descriptors, boolean ignoreUndocumentedParts) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
.protected
RequestPartsSnippet
(List<RequestPartDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
.protected
RequestPartsSnippet
(List<RequestPartDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedParts) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
. -
Method Summary
Modifier and TypeMethodDescriptionfinal RequestPartsSnippet
and
(List<RequestPartDescriptor> additionalDescriptors) Returns a newRequestPartsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.final RequestPartsSnippet
and
(RequestPartDescriptor... additionalDescriptors) Returns a newRequestPartsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.createModel
(Operation operation) Create the model that should be used during template rendering to document the givenoperation
.Methods inherited from class org.springframework.restdocs.snippet.TemplatedSnippet
document, getAttributes, getSnippetName
-
Constructor Details
-
RequestPartsSnippet
Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
. Undocumented parts will trigger a failure.- Parameters:
descriptors
- the parameter descriptors
-
RequestPartsSnippet
protected RequestPartsSnippet(List<RequestPartDescriptor> descriptors, boolean ignoreUndocumentedParts) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
. IfignoreUndocumentedParts
istrue
, undocumented parts will be ignored and will not trigger a failure.- Parameters:
descriptors
- the parameter descriptorsignoreUndocumentedParts
- whether undocumented parts should be ignored
-
RequestPartsSnippet
protected RequestPartsSnippet(List<RequestPartDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
. The givenattributes
will be included in the model during template rendering. Undocumented parts will trigger a failure.- Parameters:
descriptors
- the parameter descriptorsattributes
- the additional attributes
-
RequestPartsSnippet
protected RequestPartsSnippet(List<RequestPartDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedParts) Creates a newRequestPartsSnippet
that will document the request's parts using the givendescriptors
. The givenattributes
will be included in the model during template rendering. IfignoreUndocumentedParts
istrue
, undocumented parts will be ignored and will not trigger a failure.- Parameters:
descriptors
- the parameter descriptorsattributes
- the additional attributesignoreUndocumentedParts
- whether undocumented parts should be ignored
-
-
Method Details
-
and
Returns a newRequestPartsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.- Parameters:
additionalDescriptors
- the additional descriptors- Returns:
- the new snippet
-
and
Returns a newRequestPartsSnippet
configured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors
.- Parameters:
additionalDescriptors
- the additional descriptors- Returns:
- the new snippet
-
createModel
Description copied from class:TemplatedSnippet
Create the model that should be used during template rendering to document the givenoperation
. Any additional attributes that were supplied when thisTemplatedSnippet
were created will be automatically added to the model prior to rendering.- Specified by:
createModel
in classTemplatedSnippet
- Parameters:
operation
- the operation- Returns:
- the model
-