Package org.springdoc.core
Class SpringDocAnnotationsUtils
- java.lang.Object
-
- io.swagger.v3.core.util.AnnotationsUtils
-
- org.springdoc.core.SpringDocAnnotationsUtils
-
public class SpringDocAnnotationsUtils extends io.swagger.v3.core.util.AnnotationsUtils
The type Spring doc annotations utils.- Author:
- bnasslahsen
-
-
Constructor Summary
Constructors Constructor Description SpringDocAnnotationsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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)
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)
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)
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)
Resolve schema from type schema.-
Methods inherited from class io.swagger.v3.core.util.AnnotationsUtils
addEncodingToMediaType, applyTypes, equals, equals, equals, getAnnotation, getArraySchema, getArraySchema, getArraySchemaAnnotation, getContact, getExample, getExample, getExtensions, getExternalDocumentation, getHeader, getHeaders, getInfo, getLicense, getLink, getLinkParameters, getLinks, getSchema, getSchema, getSchemaAnnotation, getSchemaAnnotation, getSchemaAnnotation, getSchemaDeclaredAnnotation, getSchemaDeclaredAnnotation, getSchemaFromAnnotation, getSchemaFromAnnotation, getSchemaType, getSchemaType, getServer, getServers, getTags, hasArrayAnnotation, hasSchemaAnnotation, mergeArraySchemaAnnotations, mergeArrayWithSchemaAnnotation, mergeSchemaAnnotations, mergeSchemaAnnotations, removeAnnotations, resolveSchemaFromType, updateAnnotation
-
-
-
-
Method Detail
-
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)
Resolve schema from type schema.- Parameters:
schemaImplementation
- the schema implementationcomponents
- the componentsjsonView
- the json viewannotations
- the annotations- 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)
Extract schema schema.- Parameters:
components
- the componentsreturnType
- the return typejsonView
- the json viewannotations
- the annotations- 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)
Gets content.- Parameters:
annotationContents
- the annotation contentsclassTypes
- the class typesmethodTypes
- the method typesschema
- the schemacomponents
- the componentsjsonViewAnnotation
- the json view annotation- 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
public static boolean isAnnotationToIgnore(Type type)
Is annotation to ignore boolean.- Parameters:
type
- the type- Returns:
- the boolean
-
addAnnotationsToIgnore
public static void addAnnotationsToIgnore(Class<?>... classes)
Add annotations to ignore.- Parameters:
classes
- the classes
-
removeAnnotationsToIgnore
public static void removeAnnotationsToIgnore(Class<?>... classes)
Remove annotations to ignore.- Parameters:
classes
- the classes
-
-