Class OpenApiResource

java.lang.Object
io.swagger.v3.core.filter.SpecFilter
org.springdoc.api.AbstractOpenApiResource
org.springdoc.webmvc.api.OpenApiResource
Direct Known Subclasses:
OpenApiActuatorResource, OpenApiWebMvcResource

public abstract class OpenApiResource extends AbstractOpenApiResource
The type Web mvc open api resource.
Author:
bnasslahsen, Azige
  • Constructor Details

  • Method Details

    • openapiJson

      public String openapiJson(jakarta.servlet.http.HttpServletRequest request, String apiDocsUrl, Locale locale) throws com.fasterxml.jackson.core.JsonProcessingException
      Openapi json string.
      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

      public String openapiYaml(jakarta.servlet.http.HttpServletRequest request, String apiDocsUrl, Locale locale) throws com.fasterxml.jackson.core.JsonProcessingException
      Openapi yaml string.
      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
    • getPaths

      protected void getPaths(Map<String,Object> restControllers, Locale locale)
      Specified by:
      getPaths in class AbstractOpenApiResource
    • calculatePath

      protected void calculatePath(Map<String,Object> restControllers, Map<org.springframework.web.servlet.mvc.method.RequestMappingInfo,org.springframework.web.method.HandlerMethod> map, Locale locale)
      Calculate path.
      Parameters:
      restControllers - the rest controllers
      map - the map
      locale - the locale
    • calculateServerUrl

      protected void calculateServerUrl(jakarta.servlet.http.HttpServletRequest request, String apiDocsUrl, Locale locale)
      Calculate server url.
      Parameters:
      request - the request
      apiDocsUrl - the api docs url
    • getServerUrl

      protected abstract String getServerUrl(jakarta.servlet.http.HttpServletRequest request, String apiDocsUrl)
      Gets server url.
      Parameters:
      request - the request
      apiDocsUrl - the api docs url
      Returns:
      the server url