Package org.springframework.restdocs.cli
Class HttpieRequestSnippet
java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.cli.HttpieRequestSnippet
- All Implemented Interfaces:
Snippet
A
Snippet that documents the HTTPie command for a request.- Since:
- 1.1.0
- Author:
- Raman Gupta, Andy Wilkinson, Tomasz Kopczynski
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpieRequestSnippet(Map<String, Object> attributes, CommandFormatter commandFormatter) Creates a newHttpieRequestSnippetwith the given additionalattributesthat will be included in the model during template rendering.protectedHttpieRequestSnippet(CommandFormatter commandFormatter) Creates a newHttpieRequestSnippetthat will use the givencommandFormatterto format the HTTPie 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
-
HttpieRequestSnippet
Creates a newHttpieRequestSnippetthat will use the givencommandFormatterto format the HTTPie command.- Parameters:
commandFormatter- the formatter
-
HttpieRequestSnippet
Creates a newHttpieRequestSnippetwith the given additionalattributesthat will be included in the model during template rendering. The givencommandFormaatterwill be used to format the HTTPie 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
-