Class OpenApiResource

    • Constructor Detail

      • OpenApiResource

        public OpenApiResource​(String groupName,
                               org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory,
                               AbstractRequestService requestBuilder,
                               GenericResponseService responseBuilder,
                               OperationService operationParser,
                               Optional<List<OperationCustomizer>> operationCustomizers,
                               Optional<List<OpenApiCustomiser>> openApiCustomisers,
                               SpringDocConfigProperties springDocConfigProperties,
                               SpringDocProviders springDocProviders)
        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
        operationCustomizers - the operation customizers
        openApiCustomisers - the open api customisers
        springDocConfigProperties - the spring doc config properties
        springDocProviders - the spring doc providers
      • OpenApiResource

        public OpenApiResource​(org.springframework.beans.factory.ObjectFactory<OpenAPIService> openAPIBuilderObjectFactory,
                               AbstractRequestService requestBuilder,
                               GenericResponseService responseBuilder,
                               OperationService operationParser,
                               Optional<List<OperationCustomizer>> operationCustomizers,
                               Optional<List<OpenApiCustomiser>> openApiCustomisers,
                               SpringDocConfigProperties springDocConfigProperties,
                               SpringDocProviders springDocProviders)
        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
        operationCustomizers - the operation customizers
        openApiCustomisers - the open api customisers
        springDocConfigProperties - the spring doc config properties
        springDocProviders - the spring doc providers
    • Method Detail

      • openapiJson

        protected reactor.core.publisher.Mono<String> 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<String> 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
      • calculatePath

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

        protected void getWebFluxRouterFunctionPaths​(Locale locale)
        Gets web flux router function paths.
        Parameters:
        locale - the locale
      • calculateServerUrl

        protected void 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
      • 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