Example usage for org.springframework.restdocs.generate RestDocumentationGenerator ATTRIBUTE_NAME_URL_TEMPLATE

List of usage examples for org.springframework.restdocs.generate RestDocumentationGenerator ATTRIBUTE_NAME_URL_TEMPLATE

Introduction

In this page you can find the example usage for org.springframework.restdocs.generate RestDocumentationGenerator ATTRIBUTE_NAME_URL_TEMPLATE.

Prototype

String ATTRIBUTE_NAME_URL_TEMPLATE

To view the source code for org.springframework.restdocs.generate RestDocumentationGenerator ATTRIBUTE_NAME_URL_TEMPLATE.

Click Source Link

Document

Name of the operation attribute used to hold the request's URL template.

Usage

From source file:io.github.restdocsext.jersey.JerseyRestDocumentationFilter.java

@SuppressWarnings("unchecked")
@Override/*from   www  .j a  v a 2s  .  co m*/
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext)
        throws IOException {

    final Map<String, Object> configuration = new HashMap<>(
            getContextProperty(requestContext, CONTEXT_CONFIGURATION_KEY, Map.class));
    configuration.put(RestDocumentationContext.class.getName(), getContextProperty(requestContext,
            RestDocumentationContext.class.getName(), RestDocumentationContext.class));

    final String uriTemplate = createUriTemplate(
            getConfigProperty(requestContext, PATH_BUILDER_KEY, StringBuilder.class),
            getConfigProperty(requestContext, QUERY_BUILDER_KEY, StringBuilder.class));
    configuration.put(RestDocumentationGenerator.ATTRIBUTE_NAME_URL_TEMPLATE, uriTemplate);

    this.delegate.handle((ClientRequest) requestContext, (ClientResponse) responseContext, configuration);

    for (JerseyRestDocumentationFilter filter : childFilters) {
        filter.filter(requestContext, responseContext);
    }
}