Class HttpieRequestSnippet

java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.cli.HttpieRequestSnippet
All Implemented Interfaces:
Snippet

public class HttpieRequestSnippet extends TemplatedSnippet
A Snippet that documents the HTTPie command for a request.
Since:
1.1.0
Author:
Raman Gupta, Andy Wilkinson, Tomasz Kopczynski
See Also:
  • Constructor Details

    • HttpieRequestSnippet

      protected HttpieRequestSnippet(CommandFormatter commandFormatter)
      Creates a new HttpieRequestSnippet that will use the given commandFormatter to format the HTTPie command.
      Parameters:
      commandFormatter - the formatter
    • HttpieRequestSnippet

      protected HttpieRequestSnippet(Map<String,Object> attributes, CommandFormatter commandFormatter)
      Creates a new HttpieRequestSnippet with the given additional attributes that will be included in the model during template rendering. The given commandFormaatter will be used to format the HTTPie command.
      Parameters:
      attributes - the additional attributes
      commandFormatter - the formatter for generating the snippet
  • Method Details

    • createModel

      protected Map<String,Object> createModel(Operation operation)
      Description copied from class: TemplatedSnippet
      Create the model that should be used during template rendering to document the given operation. Any additional attributes that were supplied when this TemplatedSnippet were created will be automatically added to the model prior to rendering.
      Specified by:
      createModel in class TemplatedSnippet
      Parameters:
      operation - the operation
      Returns:
      the model