Package io.jmix.rest.impl.openapi
Class OpenAPIGeneratorImpl
java.lang.Object
io.jmix.rest.impl.openapi.OpenAPIGeneratorImpl
- All Implemented Interfaces:
OpenAPIGenerator
@Component("rest_OpenAPIGenerator")
public class OpenAPIGeneratorImpl
extends Object
implements OpenAPIGenerator
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected CoreProperties
protected static final String
protected static final String
protected static final String
protected Metadata
protected MetadataTools
protected io.swagger.v3.oas.models.OpenAPI
protected RestQueriesConfiguration
protected static final String
protected static final String
protected Resources
protected static final String
protected static final String
protected RestServicesConfiguration
protected javax.servlet.ServletContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
buildEntitiesPaths
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
buildEntityFilterPaths
(io.swagger.v3.oas.models.OpenAPI openAPI, MetaClass entityClass) protected void
buildEntityPath
(io.swagger.v3.oas.models.OpenAPI openAPI, MetaClass entityClass) protected void
buildEntityRUDPaths
(io.swagger.v3.oas.models.OpenAPI openAPI, MetaClass entityClass) protected void
buildEntitySchema
(io.swagger.v3.oas.models.OpenAPI openAPI, MetaClass entityClass) protected void
buildErrorSchema
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
buildInfo
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
buildQueriesPaths
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
buildServer
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
buildServicesPaths
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
buildTags
(io.swagger.v3.oas.models.OpenAPI openAPI) protected void
protected io.swagger.v3.oas.models.responses.ApiResponse
createEntityArrayResponse
(String msg, String entityName) protected io.swagger.v3.oas.models.Operation
createEntityBrowseOperation
(MetaClass entityClass) protected io.swagger.v3.oas.models.media.Content
createEntityContent
(String entityName) protected io.swagger.v3.oas.models.Operation
createEntityCreateOperation
(MetaClass entityClass) protected io.swagger.v3.oas.models.Operation
createEntityDeleteOperation
(MetaClass entityClass) protected List<io.swagger.v3.oas.models.parameters.Parameter>
createEntityOptionalParams
(boolean singleEntityOperation) protected io.swagger.v3.oas.models.Operation
createEntityReadOperation
(MetaClass entityClass) protected io.swagger.v3.oas.models.responses.ApiResponse
createEntityResponse
(String msg, String entityName) protected io.swagger.v3.oas.models.Operation
createEntitySearchOperation
(MetaClass entityClass, org.springframework.web.bind.annotation.RequestMethod method) protected io.swagger.v3.oas.models.Operation
createEntityUpdateOperation
(MetaClass entityClass) protected io.swagger.v3.oas.models.responses.ApiResponse
protected io.swagger.v3.oas.models.parameters.Parameter
createGetOperationParam
(String parameterName, String parameterType) protected List<io.swagger.v3.oas.models.parameters.Parameter>
protected io.swagger.v3.oas.models.Operation
createQueryCountOperation
(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method) protected io.swagger.v3.oas.models.Operation
createQueryOperation
(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method) protected List<io.swagger.v3.oas.models.parameters.Parameter>
createQueryOpParams
(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method, boolean generateOptionalParams) protected io.swagger.v3.oas.models.parameters.RequestBody
createQueryRequestBody
(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method) protected io.swagger.v3.oas.models.Operation
createServiceMethodOp
(String service, RestServicesConfiguration.RestMethodInfo methodInfo, org.springframework.web.bind.annotation.RequestMethod requestMethod) protected List<io.swagger.v3.oas.models.parameters.Parameter>
createServiceMethodParams
(RestServicesConfiguration.RestMethodInfo methodInfo, org.springframework.web.bind.annotation.RequestMethod requestMethod) protected io.swagger.v3.oas.models.parameters.RequestBody
createServiceMethodRequestBody
(RestServicesConfiguration.RestMethodInfo methodInfo, org.springframework.web.bind.annotation.RequestMethod method) io.swagger.v3.oas.models.OpenAPI
protected String
getEntitySchemaName
(String entityName) protected String
getEntitySchemaRef
(String entityName) protected String
protected io.swagger.v3.oas.models.media.Schema<?>
getNamePatternProperty
(MetaClass entityClass) protected io.swagger.v3.oas.models.media.Schema<?>
getObjectProperty
(String classFqn) protected io.swagger.v3.oas.models.media.Schema<?>
getPrimitiveProperty
(String type) protected io.swagger.v3.oas.models.media.Schema<?>
protected void
init()
-
Field Details
-
ENTITY_PATH
- See Also:
-
ENTITY_RUD_OPS
- See Also:
-
ENTITY_SEARCH
- See Also:
-
QUERY_PATH
- See Also:
-
QUERY_COUNT_PATH
- See Also:
-
SERVICE_PATH
- See Also:
-
SCHEMAS_PREFIX
- See Also:
-
ARRAY_SIGNATURE
- See Also:
-
coreProperties
-
servletContext
@Autowired(required=false) protected javax.servlet.ServletContext servletContext -
resources
-
metadata
-
metadataTools
-
queriesConfiguration
-
servicesConfiguration
-
openAPI
protected io.swagger.v3.oas.models.OpenAPI openAPI
-
-
Constructor Details
-
OpenAPIGeneratorImpl
public OpenAPIGeneratorImpl()
-
-
Method Details
-
generateOpenAPI
public io.swagger.v3.oas.models.OpenAPI generateOpenAPI()- Specified by:
generateOpenAPI
in interfaceOpenAPIGenerator
- Returns:
- a
OpenAPI
object that can be transformed to JSON or YAML version of documentation
-
checkInitialized
protected void checkInitialized() -
init
protected void init() -
buildServer
protected void buildServer(io.swagger.v3.oas.models.OpenAPI openAPI) -
buildInfo
protected void buildInfo(io.swagger.v3.oas.models.OpenAPI openAPI) -
buildErrorSchema
protected void buildErrorSchema(io.swagger.v3.oas.models.OpenAPI openAPI) -
buildTags
protected void buildTags(io.swagger.v3.oas.models.OpenAPI openAPI) -
buildEntitiesPaths
protected void buildEntitiesPaths(io.swagger.v3.oas.models.OpenAPI openAPI) -
buildEntitySchema
-
buildEntityPath
-
buildEntityRUDPaths
-
buildEntityFilterPaths
protected void buildEntityFilterPaths(io.swagger.v3.oas.models.OpenAPI openAPI, MetaClass entityClass) -
createEntityCreateOperation
-
createEntityBrowseOperation
-
createEntityReadOperation
-
createEntityUpdateOperation
-
createEntityDeleteOperation
-
createEntitySearchOperation
protected io.swagger.v3.oas.models.Operation createEntitySearchOperation(MetaClass entityClass, org.springframework.web.bind.annotation.RequestMethod method) -
createEntityOptionalParams
protected List<io.swagger.v3.oas.models.parameters.Parameter> createEntityOptionalParams(boolean singleEntityOperation) -
getNamePatternProperty
-
buildServicesPaths
protected void buildServicesPaths(io.swagger.v3.oas.models.OpenAPI openAPI) -
createServiceMethodOp
protected io.swagger.v3.oas.models.Operation createServiceMethodOp(String service, RestServicesConfiguration.RestMethodInfo methodInfo, org.springframework.web.bind.annotation.RequestMethod requestMethod) -
createServiceMethodParams
protected List<io.swagger.v3.oas.models.parameters.Parameter> createServiceMethodParams(RestServicesConfiguration.RestMethodInfo methodInfo, org.springframework.web.bind.annotation.RequestMethod requestMethod) -
createServiceMethodRequestBody
@Nullable protected io.swagger.v3.oas.models.parameters.RequestBody createServiceMethodRequestBody(RestServicesConfiguration.RestMethodInfo methodInfo, org.springframework.web.bind.annotation.RequestMethod method) -
buildQueriesPaths
protected void buildQueriesPaths(io.swagger.v3.oas.models.OpenAPI openAPI) -
createQueryOperation
protected io.swagger.v3.oas.models.Operation createQueryOperation(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method) -
createQueryCountOperation
protected io.swagger.v3.oas.models.Operation createQueryCountOperation(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method) -
createQueryOpParams
protected List<io.swagger.v3.oas.models.parameters.Parameter> createQueryOpParams(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method, boolean generateOptionalParams) -
createOptionalQueryParams
-
createQueryRequestBody
@Nullable protected io.swagger.v3.oas.models.parameters.RequestBody createQueryRequestBody(RestQueriesConfiguration.QueryInfo query, org.springframework.web.bind.annotation.RequestMethod method) -
createGetOperationParam
-
getPropertyFromJavaType
-
getObjectProperty
-
getPrimitiveProperty
-
createErrorResponse
-
createEntityResponse
-
createEntityArrayResponse
-
createEntityContent
-
getEntitySchemaName
-
getEntitySchemaRef
-
getErrorSchemaRef
-