Package org.springdoc.api
Class OpenApiResource
- java.lang.Object
-
- org.springdoc.api.AbstractOpenApiResource
-
- org.springdoc.api.OpenApiResource
-
@RestController @ConditionalOnProperty(name="springdoc.api-docs.enabled", matchIfMissing=true) public class OpenApiResource extends AbstractOpenApiResource
-
-
Constructor Summary
Constructors Constructor Description OpenApiResource(OpenAPIBuilder openAPIBuilder, AbstractRequestBuilder requestBuilder, AbstractResponseBuilder responseBuilder, OperationBuilder operationParser, org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping requestMappingHandlerMapping, Optional<org.springdoc.api.ActuatorProvider> servletContextProvider, Optional<List<OpenApiCustomiser>> openApiCustomisers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
getPaths(Map<String,Object> restControllers)
String
openapiJson(javax.servlet.http.HttpServletRequest request, String apiDocsUrl)
String
openapiYaml(javax.servlet.http.HttpServletRequest request, String apiDocsUrl)
-
Methods inherited from class org.springdoc.api.AbstractOpenApiResource
calculatePath, getOpenApi
-
-
-
-
Constructor Detail
-
OpenApiResource
public OpenApiResource(OpenAPIBuilder openAPIBuilder, AbstractRequestBuilder requestBuilder, AbstractResponseBuilder responseBuilder, OperationBuilder operationParser, org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping requestMappingHandlerMapping, Optional<org.springdoc.api.ActuatorProvider> servletContextProvider, Optional<List<OpenApiCustomiser>> openApiCustomisers)
-
-
Method Detail
-
openapiJson
@GetMapping(value="${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}", produces="application/json") public String openapiJson(javax.servlet.http.HttpServletRequest request, @Value("${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}") String apiDocsUrl) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
openapiYaml
@GetMapping(value="${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}.yaml", produces="application/vnd.oai.openapi") public String openapiYaml(javax.servlet.http.HttpServletRequest request, @Value("${springdoc.api-docs.path:#{T(org.springdoc.core.Constants).DEFAULT_API_DOCS_URL}}.yaml") String apiDocsUrl) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getPaths
protected void getPaths(Map<String,Object> restControllers)
- Specified by:
getPaths
in classAbstractOpenApiResource
-
-