Class ResponseBodySnippet

All Implemented Interfaces:
Snippet

public class ResponseBodySnippet extends AbstractBodySnippet
A Snippet that documents the body of a response.
Author:
Andy Wilkinson
  • Constructor Details

    • ResponseBodySnippet

      public ResponseBodySnippet()
      Creates a new ResponseBodySnippet.
    • ResponseBodySnippet

      public ResponseBodySnippet(@Nullable PayloadSubsectionExtractor<?> subsectionExtractor)
      Creates a new ResponseBodySnippet that will document the subsection of the response body extracted by the given subsectionExtractor. If the extractor is null the entire response body will be documented.
      Parameters:
      subsectionExtractor - the subsection extractor, or null to document the entire response body
    • ResponseBodySnippet

      public ResponseBodySnippet(@Nullable Map<String,Object> attributes)
      Creates a new ResponseBodySnippet with the given additional attributes that will be included in the model during template rendering.
      Parameters:
      attributes - the additional attributes
    • ResponseBodySnippet

      public ResponseBodySnippet(@Nullable PayloadSubsectionExtractor<?> subsectionExtractor, @Nullable Map<String,Object> attributes)
      Creates a new ResponseBodySnippet that will document the subsection of the response body extracted by the given subsectionExtractor. If the extractor is null the entire response body will be documented. The given additional attributes that will be included in the model during template rendering.
      Parameters:
      subsectionExtractor - the subsection extractor, or null to document the entire response body
      attributes - the additional attributes
  • Method Details