Package org.springframework.restdocs.cli
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
ModifierConstructorDescriptionprotected
CurlRequestSnippet
(Map<String, Object> attributes, CommandFormatter commandFormatter) Creates a newCurlRequestSnippet
with the given additionalattributes
that will be included in the model during template rendering.protected
CurlRequestSnippet
(CommandFormatter commandFormatter) Creates a newCurlRequestSnippet
that will use the givencommandFormatter
to 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 org.springframework.restdocs.snippet.TemplatedSnippet
document, getAttributes, getSnippetName
-
Constructor Details
-
CurlRequestSnippet
Creates a newCurlRequestSnippet
that will use the givencommandFormatter
to format the curl command.- Parameters:
commandFormatter
- the formatter
-
CurlRequestSnippet
Creates a newCurlRequestSnippet
with the given additionalattributes
that will be included in the model during template rendering. The givencommandFormaatter
will 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: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
-