Package org.springdoc.core.utils
Class SpringDocAnnotationsUtils
java.lang.Object
io.swagger.v3.core.util.AnnotationsUtils
org.springdoc.core.utils.SpringDocAnnotationsUtils
public class SpringDocAnnotationsUtils
extends io.swagger.v3.core.util.AnnotationsUtils
The type Spring doc annotations utils.
- Author:
- bnasslahsen
-
Field Summary
Fields inherited from class io.swagger.v3.core.util.AnnotationsUtils
COMPONENTS_REF
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAnnotationsToIgnore
(Class<?>... classes) Add annotations to ignore.static io.swagger.v3.oas.models.media.Schema
extractSchema
(io.swagger.v3.oas.models.Components components, Type returnType, com.fasterxml.jackson.annotation.JsonView jsonView, Annotation[] annotations, io.swagger.v3.oas.models.SpecVersion specVersion) Extract schema schema.static Optional<io.swagger.v3.oas.models.media.Content>
getContent
(io.swagger.v3.oas.annotations.media.Content[] annotationContents, String[] classTypes, String[] methodTypes, io.swagger.v3.oas.models.media.Schema schema, io.swagger.v3.oas.models.Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31) Gets content.static boolean
isAnnotationToIgnore
(Type type) Is annotation to ignore boolean.static boolean
isAnnotationToIgnore
(org.springframework.core.MethodParameter parameter) Is annotation to ignore boolean.static void
mergeSchema
(io.swagger.v3.oas.models.media.Content existingContent, io.swagger.v3.oas.models.media.Schema<?> schemaN, String mediaTypeStr) Merge schema.static void
removeAnnotationsToIgnore
(Class<?>... classes) Remove annotations to ignore.static Object
resolveDefaultValue
(String defaultValueStr, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Resolve default value object.static io.swagger.v3.oas.models.media.Schema
resolveSchemaFromType
(Class<?> schemaImplementation, io.swagger.v3.oas.models.Components components, com.fasterxml.jackson.annotation.JsonView jsonView, Annotation[] annotations, io.swagger.v3.oas.models.SpecVersion specVersion) Resolve schema from type schema.Methods inherited from class io.swagger.v3.core.util.AnnotationsUtils
addEncodingToMediaType, addEncodingToMediaType, applyTypes, clone, equals, equals, equals, getAnnotation, getArraySchema, getArraySchema, getArraySchema, getArraySchema, getArraySchema, getArraySchemaAnnotation, getContact, getContact, getContent, getExample, getExample, getExtensions, getExtensions, getExternalDocumentation, getExternalDocumentation, getHeader, getHeader, getHeaders, getHeaders, getInfo, getInfo, getLicense, getLicense, getLink, getLink, getLinkParameters, getLinks, getLinks, getSchema, getSchema, getSchema, getSchema, getSchemaAnnotation, getSchemaAnnotation, getSchemaAnnotation, getSchemaDeclaredAnnotation, getSchemaDeclaredAnnotation, getSchemaFromAnnotation, getSchemaFromAnnotation, getSchemaFromAnnotation, getSchemaFromAnnotation, getSchemaFromAnnotation, getSchemaFromAnnotation, getSchemaType, getSchemaType, getServer, getServers, getTags, hasArrayAnnotation, hasSchemaAnnotation, mergeArraySchemaAnnotations, mergeArrayWithSchemaAnnotation, mergeSchemaAnnotations, mergeSchemaAnnotations, removeAnnotations, resolveSchemaFromType, resolveSchemaFromType, resolveSchemaFromType, updateAnnotation
-
Constructor Details
-
SpringDocAnnotationsUtils
public SpringDocAnnotationsUtils()
-
-
Method Details
-
resolveSchemaFromType
public static io.swagger.v3.oas.models.media.Schema resolveSchemaFromType(Class<?> schemaImplementation, io.swagger.v3.oas.models.Components components, com.fasterxml.jackson.annotation.JsonView jsonView, Annotation[] annotations, io.swagger.v3.oas.models.SpecVersion specVersion) Resolve schema from type schema.- Parameters:
schemaImplementation
- the schema implementationcomponents
- the componentsjsonView
- the json viewannotations
- the annotationsspecVersion
- the spec version- Returns:
- the schema
-
extractSchema
public static io.swagger.v3.oas.models.media.Schema extractSchema(io.swagger.v3.oas.models.Components components, Type returnType, com.fasterxml.jackson.annotation.JsonView jsonView, Annotation[] annotations, io.swagger.v3.oas.models.SpecVersion specVersion) Extract schema schema.- Parameters:
components
- the componentsreturnType
- the return typejsonView
- the json viewannotations
- the annotationsspecVersion
- the spec version- Returns:
- the schema
-
getContent
public static Optional<io.swagger.v3.oas.models.media.Content> getContent(io.swagger.v3.oas.annotations.media.Content[] annotationContents, String[] classTypes, String[] methodTypes, io.swagger.v3.oas.models.media.Schema schema, io.swagger.v3.oas.models.Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31) Gets content.- Parameters:
annotationContents
- the annotation contentsclassTypes
- the class typesmethodTypes
- the method typesschema
- the schemacomponents
- the componentsjsonViewAnnotation
- the json view annotationopenapi31
- the openapi 31- Returns:
- the content
-
mergeSchema
public static void mergeSchema(io.swagger.v3.oas.models.media.Content existingContent, io.swagger.v3.oas.models.media.Schema<?> schemaN, String mediaTypeStr) Merge schema.- Parameters:
existingContent
- the existing contentschemaN
- the schema nmediaTypeStr
- the media type str
-
isAnnotationToIgnore
public static boolean isAnnotationToIgnore(org.springframework.core.MethodParameter parameter) Is annotation to ignore boolean.- Parameters:
parameter
- the parameter- Returns:
- the boolean
-
isAnnotationToIgnore
Is annotation to ignore boolean.- Parameters:
type
- the type- Returns:
- the boolean
-
addAnnotationsToIgnore
Add annotations to ignore.- Parameters:
classes
- the classes
-
removeAnnotationsToIgnore
Remove annotations to ignore.- Parameters:
classes
- the classes
-
resolveDefaultValue
public static Object resolveDefaultValue(String defaultValueStr, com.fasterxml.jackson.databind.ObjectMapper objectMapper) Resolve default value object.- Parameters:
defaultValueStr
- the default value strobjectMapper
- the object mapper- Returns:
- the object
-