Class SnippetConfigurer<PARENT,TYPE>

Type Parameters:
PARENT - the type of the configurer's parent
TYPE - the concrete type of the configurer to be returned from chained methods
Direct Known Subclasses:
MockMvcSnippetConfigurer, RestAssuredSnippetConfigurer, WebTestClientSnippetConfigurer

public abstract class SnippetConfigurer<PARENT,TYPE> extends AbstractNestedConfigurer<PARENT>
A configurer that can be used to configure the generated documentation snippets.
Since:
1.1.0
Author:
Andy Wilkinson
  • Field Details

  • Constructor Details

    • SnippetConfigurer

      protected SnippetConfigurer(PARENT parent)
      Creates a new SnippetConfigurer with the given parent.
      Parameters:
      parent - the parent
  • Method Details

    • apply

      public void apply(Map<String,Object> configuration, RestDocumentationContext context)
      Description copied from class: AbstractConfigurer
      Applies the configurer to the given configuration.
      Specified by:
      apply in class AbstractConfigurer
      Parameters:
      configuration - the configuration to be configured
      context - the current documentation context
    • withEncoding

      public TYPE withEncoding(String encoding)
      Configures any documentation snippets to be written using the given encoding. The default is UTF-8.
      Parameters:
      encoding - the encoding
      Returns:
      this
    • withDefaults

      public TYPE withDefaults(Snippet... defaultSnippets)
      Configures the documentation snippets that will be produced by default.
      Parameters:
      defaultSnippets - the default snippets
      Returns:
      this
      See Also:
    • withAdditionalDefaults

      public TYPE withAdditionalDefaults(Snippet... additionalDefaultSnippets)
      Configures additional documentation snippets that will be produced by default.
      Parameters:
      additionalDefaultSnippets - the additional default snippets
      Returns:
      this
      See Also:
    • withTemplateFormat

      public TYPE withTemplateFormat(TemplateFormat format)
      Configures the format of the documentation snippet templates.
      Parameters:
      format - the snippet template format
      Returns:
      this