Class ResponseHeadersSnippet

All Implemented Interfaces:
Snippet

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

    • ResponseHeadersSnippet

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

      protected ResponseHeadersSnippet(List<HeaderDescriptor> descriptors, Map<String,Object> attributes)
      Creates a new ResponseHeadersSnippet that will document the headers in the response 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 ResponseHeadersSnippet and(HeaderDescriptor... additionalDescriptors)
      Returns a new ResponseHeadersSnippet 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 ResponseHeadersSnippet and(List<HeaderDescriptor> additionalDescriptors)
      Returns a new ResponseHeadersSnippet configured with this snippet's attributes and its descriptors combined with the given additionalDescriptors.
      Parameters:
      additionalDescriptors - the additional descriptors
      Returns:
      the new snippet