Class OpenApiWebMvcResource

java.lang.Object
io.swagger.v3.core.filter.SpecFilter

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

  • Method Details

    • openapiJson

      @GetMapping(value="${springdoc.api-docs.path:#{T(org.springdoc.core.utils.Constants).DEFAULT_API_DOCS_URL}}", produces="application/json") public String openapiJson(jakarta.servlet.http.HttpServletRequest request, @Value("${springdoc.api-docs.path:#{T(org.springdoc.core.utils.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.utils.Constants).DEFAULT_API_DOCS_URL}}.yaml", produces="application/vnd.oai.openapi") public String openapiYaml(jakarta.servlet.http.HttpServletRequest request, @Value("${springdoc.api-docs.path:#{T(org.springdoc.core.utils.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(jakarta.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