Class RequestHeadersSnippet

All Implemented Interfaces:
Snippet

public class RequestHeadersSnippet extends AbstractHeadersSnippet
A Snippet that documents the headers in a request.
Author:
Andreas Evers, Andy Wilkinson
See Also:
  • Constructor Details

    • RequestHeadersSnippet

      protected RequestHeadersSnippet(List<HeaderDescriptor> descriptors)
      Creates a new RequestHeadersSnippet that will document the headers in the request using the given descriptors.
      Parameters:
      descriptors - the descriptors
    • RequestHeadersSnippet

      protected RequestHeadersSnippet(List<HeaderDescriptor> descriptors, Map<String,Object> attributes)
      Creates a new RequestHeadersSnippet that will document the headers in the request using the given descriptors. The given attributes will be included in the model during template rendering.
      Parameters:
      descriptors - the descriptors
      attributes - the additional attributes
  • Method Details

    • extractActualHeaders

      protected Set<String> extractActualHeaders(Operation operation)
      Description copied from class: AbstractHeadersSnippet
      Extracts the names of the headers from the request or response of the given operation.
      Specified by:
      extractActualHeaders in class AbstractHeadersSnippet
      Parameters:
      operation - the operation
      Returns:
      the header names
    • and

      public final RequestHeadersSnippet and(HeaderDescriptor... additionalDescriptors)
      Returns a new RequestHeadersSnippet configured with this snippet's attributes and its descriptors combined with the given additionalDescriptors.
      Parameters:
      additionalDescriptors - the additional descriptors
      Returns:
      the new snippet
    • and

      public final RequestHeadersSnippet and(List<HeaderDescriptor> additionalDescriptors)
      Returns a new RequestHeadersSnippet configured with this snippet's attributes and its descriptors combined with the given additionalDescriptors.
      Parameters:
      additionalDescriptors - the additional descriptors
      Returns:
      the new snippet