Class OpenApiResource

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

public abstract class OpenApiResource extends org.springdoc.api.AbstractOpenApiResource
The type Open api resource.
Author:
bnasslahsen, Azige
  • Field Summary

    Fields inherited from class org.springdoc.api.AbstractOpenApiResource

    groupName, openAPIService, springDocConfigProperties, springDocCustomizers, springDocProviders
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    OpenApiResource(String groupName, org.springframework.beans.factory.ObjectFactory<org.springdoc.core.service.OpenAPIService> openAPIBuilderObjectFactory, org.springdoc.core.service.AbstractRequestService requestBuilder, org.springdoc.core.service.GenericResponseService responseBuilder, org.springdoc.core.service.OperationService operationParser, org.springdoc.core.properties.SpringDocConfigProperties springDocConfigProperties, org.springdoc.core.providers.SpringDocProviders springDocProviders, org.springdoc.core.customizers.SpringDocCustomizers springDocCustomizers)
    Instantiates a new Open api resource.
    protected
    OpenApiResource(org.springframework.beans.factory.ObjectFactory<org.springdoc.core.service.OpenAPIService> openAPIBuilderObjectFactory, org.springdoc.core.service.AbstractRequestService requestBuilder, org.springdoc.core.service.GenericResponseService responseBuilder, org.springdoc.core.service.OperationService operationParser, org.springdoc.core.properties.SpringDocConfigProperties springDocConfigProperties, org.springdoc.core.providers.SpringDocProviders springDocProviders, org.springdoc.core.customizers.SpringDocCustomizers springDocCustomizers)
    Instantiates a new Open api resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    calculatePath(Map<String,Object> restControllers, Map<org.springframework.web.reactive.result.method.RequestMappingInfo,org.springframework.web.method.HandlerMethod> map, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
    Calculate path.
    protected String
    calculateServerUrl(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale)
    Calculate server url.
    protected void
    getPaths(Map<String,Object> restControllers, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
    Gets paths.
    protected abstract String
    getServerUrl(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl)
    Gets server url.
    protected void
    getWebFluxRouterFunctionPaths(Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
    Gets web flux router function paths.
    protected reactor.core.publisher.Mono<byte[]>
    openapiJson(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale)
    Openapi json mono.
    protected reactor.core.publisher.Mono<byte[]>
    openapiYaml(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale)
    Openapi yaml mono.

    Methods inherited from class org.springdoc.api.AbstractOpenApiResource

    addHiddenRestControllers, addHiddenRestControllers, addRestControllers, calculatePath, calculatePath, calculatePath, calculatePath, calculateWebhooks, containsResponseBody, customizeOperation, customizeRouterOperation, decode, getActuatorURI, getDefaultAllowedHttpMethods, getOpenApi, getOpenApi, getRouterFunctionPaths, initOpenAPIBuilder, isActuatorRestController, isAdditionalRestController, isConditionToMatch, isFilterCondition, isHiddenRestControllers, isMethodToFilter, isPackageToScan, isPathToMatch, isRestController, mergeRouters, setModelAndViewClass, writeJsonValue, writeYamlValue

    Methods inherited from class io.swagger.v3.core.filter.SpecFilter

    filter, filterComponentsSchema, filterOpenAPI, filterOperation, filterParameter, filterPathItem, filterRequestBody, filterResponse, locateReferencedDefinitions, removeBrokenReferenceDefinitions, resolveAllNestedRefs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OpenApiResource

      protected OpenApiResource(String groupName, org.springframework.beans.factory.ObjectFactory<org.springdoc.core.service.OpenAPIService> openAPIBuilderObjectFactory, org.springdoc.core.service.AbstractRequestService requestBuilder, org.springdoc.core.service.GenericResponseService responseBuilder, org.springdoc.core.service.OperationService operationParser, org.springdoc.core.properties.SpringDocConfigProperties springDocConfigProperties, org.springdoc.core.providers.SpringDocProviders springDocProviders, org.springdoc.core.customizers.SpringDocCustomizers springDocCustomizers)
      Instantiates a new Open api 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
    • OpenApiResource

      protected OpenApiResource(org.springframework.beans.factory.ObjectFactory<org.springdoc.core.service.OpenAPIService> openAPIBuilderObjectFactory, org.springdoc.core.service.AbstractRequestService requestBuilder, org.springdoc.core.service.GenericResponseService responseBuilder, org.springdoc.core.service.OperationService operationParser, org.springdoc.core.properties.SpringDocConfigProperties springDocConfigProperties, org.springdoc.core.providers.SpringDocProviders springDocProviders, org.springdoc.core.customizers.SpringDocCustomizers springDocCustomizers)
      Instantiates a new Open api 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

      protected reactor.core.publisher.Mono<byte[]> openapiJson(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) throws com.fasterxml.jackson.core.JsonProcessingException
      Openapi json mono.
      Parameters:
      serverHttpRequest - the server http request
      apiDocsUrl - the api docs url
      locale - the locale
      Returns:
      the mono
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
    • openapiYaml

      protected reactor.core.publisher.Mono<byte[]> openapiYaml(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale) throws com.fasterxml.jackson.core.JsonProcessingException
      Openapi yaml mono.
      Parameters:
      serverHttpRequest - the server http request
      apiDocsUrl - the api docs url
      locale - the locale
      Returns:
      the mono
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - the json processing exception
    • getPaths

      protected void getPaths(Map<String,Object> restControllers, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
      Gets paths.
      Specified by:
      getPaths in class org.springdoc.api.AbstractOpenApiResource
      Parameters:
      restControllers - the rest controllers
      locale - the locale
    • calculatePath

      protected void calculatePath(Map<String,Object> restControllers, Map<org.springframework.web.reactive.result.method.RequestMappingInfo,org.springframework.web.method.HandlerMethod> map, Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
      Calculate path.
      Parameters:
      restControllers - the rest controllers
      map - the map
      locale - the locale
      openAPI - the open api
    • getWebFluxRouterFunctionPaths

      protected void getWebFluxRouterFunctionPaths(Locale locale, io.swagger.v3.oas.models.OpenAPI openAPI)
      Gets web flux router function paths.
      Parameters:
      locale - the locale
      openAPI - the open api
    • calculateServerUrl

      protected String calculateServerUrl(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl, Locale locale)
      Calculate server url.
      Parameters:
      serverHttpRequest - the server http request
      apiDocsUrl - the api docs url
      locale - the locale
      Returns:
      the string
    • getServerUrl

      protected abstract String getServerUrl(org.springframework.http.server.reactive.ServerHttpRequest serverHttpRequest, String apiDocsUrl)
      Gets server url.
      Parameters:
      serverHttpRequest - the server http request
      apiDocsUrl - the api docs url
      Returns:
      the server url