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

    • OpenApiWebMvcResource

      public OpenApiWebMvcResource(String groupName, org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers)
      Instantiates a new Open api web mvc resource.
      Parameters:
      groupName - the group name
      openAPIBuilderObjectFactory - the open api builder object factory
      requestBuilder - the request builder
      responseBuilder - the response builder
      operationParser - the operation parser
      springDocConfigProperties - the spring doc config properties
      springDocProviders - the spring doc providers
      springDocCustomizers - the spring doc customizers
    • OpenApiWebMvcResource

      @Autowired public OpenApiWebMvcResource(org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory, AbstractRequestService requestBuilder, GenericResponseService responseBuilder, OperationService operationParser, SpringDocConfigProperties springDocConfigProperties, SpringDocProviders springDocProviders, SpringDocCustomizers springDocCustomizers)
      Instantiates a new Open api web mvc resource.
      Parameters:
      openAPIBuilderObjectFactory - the open api builder object factory
      requestBuilder - the request builder
      responseBuilder - the response builder
      operationParser - the operation parser
      springDocConfigProperties - the spring doc config properties
      springDocProviders - the spring doc providers
      springDocCustomizers - the spring doc customizers
  • Method Details

    • openapiJson

      @GetMapping(value="${springdoc.api-docs.path:#{T(org.springdoc.core.utils.Constants).DEFAULT_API_DOCS_URL}}", produces="application/json") public byte[] 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 byte[] 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