Class RequestBodySnippet

All Implemented Interfaces:
Snippet

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

    • RequestBodySnippet

      public RequestBodySnippet()
      Creates a new RequestBodySnippet.
    • RequestBodySnippet

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

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

      public RequestBodySnippet(@Nullable PayloadSubsectionExtractor<?> subsectionExtractor, @Nullable Map<String,Object> attributes)
      Creates a new RequestBodySnippet that will document the subsection of the request body extracted by the given subsectionExtractor. If the extractor is null, the entire 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 body
      attributes - the additional attributes
  • Method Details