Class RestDocumentationConfigurer<S extends AbstractConfigurer,P extends AbstractConfigurer,T>

java.lang.Object
org.springframework.restdocs.config.RestDocumentationConfigurer<S,P,T>
Type Parameters:
S - the concrete type of the SnippetConfigurer
P - the concrete type of the OperationPreprocessorsConfigurer
T - the concrete type of this configurer, to be returned from methods that support chaining
Direct Known Subclasses:
MockMvcRestDocumentationConfigurer, RestAssuredRestDocumentationConfigurer, WebTestClientRestDocumentationConfigurer

public abstract class RestDocumentationConfigurer<S extends AbstractConfigurer,P extends AbstractConfigurer,T> extends Object
Abstract base class for the configuration of Spring REST Docs.
Since:
1.1.0
Author:
Andy Wilkinson, Filip Hrisafov
  • Constructor Details

    • RestDocumentationConfigurer

      public RestDocumentationConfigurer()
  • Method Details

    • snippets

      public abstract S snippets()
      Returns a SnippetConfigurer that can be used to configure the snippets that will be generated.
      Returns:
      the snippet configurer
    • operationPreprocessors

      public abstract P operationPreprocessors()
      Returns an OperationPreprocessorsConfigurer that can be used to configure the operation request and response preprocessors that will be used.
      Returns:
      the operation preprocessors configurer
    • templateEngine

      public final T templateEngine(TemplateEngine templateEngine)
      Configures the TemplateEngine that will be used for snippet rendering.
      Parameters:
      templateEngine - the template engine to use
      Returns:
      this
    • writerResolver

      public final T writerResolver(WriterResolver writerResolver)
      Configures the WriterResolver that will be used to resolve a writer for a snippet.
      Parameters:
      writerResolver - the writer resolver to use
      Returns:
      this
    • apply

      protected final void apply(Map<String,Object> configuration, RestDocumentationContext context)
      Applies this configurer to the given configuration within the given context.
      Parameters:
      configuration - the configuration
      context - the current context