Class HttpResponseSnippet

java.lang.Object
org.springframework.restdocs.snippet.TemplatedSnippet
org.springframework.restdocs.http.HttpResponseSnippet
All Implemented Interfaces:
Snippet

public class HttpResponseSnippet extends TemplatedSnippet
A Snippet that documents an HTTP response.
Author:
Andy Wilkinson
See Also:
  • Constructor Details

    • HttpResponseSnippet

      protected HttpResponseSnippet()
      Creates a new HttpResponseSnippet with no additional attributes.
    • HttpResponseSnippet

      protected HttpResponseSnippet(Map<String,Object> attributes)
      Creates a new HttpResponseSnippet with the given additional attributes that will be included in the model during template rendering.
      Parameters:
      attributes - the additional attributes
  • 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