Class CurlRequestSnippet
java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.cli.CurlRequestSnippet
- All Implemented Interfaces:
Snippet
A
Snippet that documents the curl command for a request.- Since:
- 1.1.0
- Author:
- Andy Wilkinson, Paul-Christian Volkmer, Tomasz Kopczynski
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCurlRequestSnippet(@Nullable Map<String, Object> attributes, CommandFormatter commandFormatter) Creates a newCurlRequestSnippetwith the given additionalattributesthat will be included in the model during template rendering.protectedCurlRequestSnippet(CommandFormatter commandFormatter) Creates a newCurlRequestSnippetthat will use the givencommandFormatterto format the curl command. -
Method Summary
Modifier and TypeMethodDescriptioncreateModel(Operation operation) Create the model that should be used during template rendering to document the givenoperation.Methods inherited from class TemplatedSnippet
document, getAttributes, getSnippetName
-
Constructor Details
-
CurlRequestSnippet
Creates a newCurlRequestSnippetthat will use the givencommandFormatterto format the curl command.- Parameters:
commandFormatter- the formatter
-
CurlRequestSnippet
protected CurlRequestSnippet(@Nullable Map<String, Object> attributes, CommandFormatter commandFormatter) Creates a newCurlRequestSnippetwith the given additionalattributesthat will be included in the model during template rendering. The givencommandFormatterwill be used to format the curl command.- Parameters:
attributes- the additional attributescommandFormatter- the formatter for generating the snippet
-
-
Method Details
-
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
-