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
ConstructorsModifierConstructorDescriptionprotectedRequestPartsSnippet(List<RequestPartDescriptor> descriptors) Creates a newRequestPartsSnippetthat will document the request's parts using the givendescriptors.protectedRequestPartsSnippet(List<RequestPartDescriptor> descriptors, boolean ignoreUndocumentedParts) Creates a newRequestPartsSnippetthat will document the request's parts using the givendescriptors.protectedRequestPartsSnippet(List<RequestPartDescriptor> descriptors, Map<String, Object> attributes) Creates a newRequestPartsSnippetthat will document the request's parts using the givendescriptors.protectedRequestPartsSnippet(List<RequestPartDescriptor> descriptors, Map<String, Object> attributes, boolean ignoreUndocumentedParts) Creates a newRequestPartsSnippetthat will document the request's parts using the givendescriptors. -
Method Summary
Modifier and TypeMethodDescriptionfinal RequestPartsSnippetand(List<RequestPartDescriptor> additionalDescriptors) Returns a newRequestPartsSnippetconfigured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors.final RequestPartsSnippetand(RequestPartDescriptor... additionalDescriptors) Returns a newRequestPartsSnippetconfigured 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 newRequestPartsSnippetthat 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 newRequestPartsSnippetthat will document the request's parts using the givendescriptors. IfignoreUndocumentedPartsistrue, 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 newRequestPartsSnippetthat will document the request's parts using the givendescriptors. The givenattributeswill 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 newRequestPartsSnippetthat will document the request's parts using the givendescriptors. The givenattributeswill be included in the model during template rendering. IfignoreUndocumentedPartsistrue, 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 newRequestPartsSnippetconfigured with this snippet's attributes and its descriptors combined with the givenadditionalDescriptors.- Parameters:
additionalDescriptors- the additional descriptors- Returns:
- the new snippet
-
and
Returns a newRequestPartsSnippetconfigured 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:TemplatedSnippetCreate the model that should be used during template rendering to document the givenoperation. Any additional attributes that were supplied when thisTemplatedSnippetwere created will be automatically added to the model prior to rendering.- Specified by:
createModelin classTemplatedSnippet- Parameters:
operation- the operation- Returns:
- the model
-