Class OpenApiWebMvcResource


  • @RestController
    public class OpenApiWebMvcResource
    extends OpenApiResource
    The type Open api resource.
    Author:
    bnasslahsen
    • Method Detail

      • openapiJson

        @GetMapping(value="${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}",
                    produces="application/json")
        public String openapiJson​(javax.servlet.http.HttpServletRequest request,
                                  @Value("${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}")
                                  String apiDocsUrl,
                                  Locale locale)
                           throws com.fasterxml.jackson.core.JsonProcessingException
        Openapi json string.
        Overrides:
        openapiJson in class OpenApiResource
        Parameters:
        request - the request
        apiDocsUrl - the api docs url
        locale - the locale
        Returns:
        the string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
      • openapiYaml

        @GetMapping(value="${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}.yaml",
                    produces="application/vnd.oai.openapi")
        public String openapiYaml​(javax.servlet.http.HttpServletRequest request,
                                  @Value("${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}.yaml")
                                  String apiDocsUrl,
                                  Locale locale)
                           throws com.fasterxml.jackson.core.JsonProcessingException
        Openapi yaml string.
        Overrides:
        openapiYaml in class OpenApiResource
        Parameters:
        request - the request
        apiDocsUrl - the api docs url
        locale - the locale
        Returns:
        the string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
      • getServerUrl

        protected String getServerUrl​(javax.servlet.http.HttpServletRequest request,
                                      String apiDocsUrl)
        Gets server url.
        Specified by:
        getServerUrl in class OpenApiResource
        Parameters:
        request - the request
        apiDocsUrl - the api docs url
        Returns:
        the server url