Package io.swagger.v3.core.util
Class AnnotationsUtils
- java.lang.Object
-
- io.swagger.v3.core.util.AnnotationsUtils
-
public abstract class AnnotationsUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENTS_REF
-
Constructor Summary
Constructors Constructor Description AnnotationsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddEncodingToMediaType(MediaType mediaType, Encoding encoding, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static voidaddEncodingToMediaType(MediaType mediaType, Encoding encoding, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static voidapplyTypes(String[] classTypes, String[] methodTypes, Content content, MediaType mediaType)static Schemaclone(Schema schema, boolean openapi31)static booleanequals(ArraySchema thisArraySchema, ArraySchema thatArraySchema)static booleanequals(Schema thisSchema, Schema thatSchema)static booleanequals(Annotation thisAnnotation, Annotation thatAnnotation)static <T> TgetAnnotation(Class<T> cls, Annotation... annotations)static Optional<ArraySchema>getArraySchema(ArraySchema arraySchema, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<ArraySchema>getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<ArraySchema>getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Schema>getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema)static Optional<Schema>getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema, boolean processSchemaImplementation)static ArraySchemagetArraySchemaAnnotation(Annotation... annotations)static Optional<Contact>getContact(Contact contact)static Optional<Contact>getContact(Contact contact, boolean openapi31)static Optional<Content>getContent(Content[] annotationContents, String[] classTypes, String[] methodTypes, Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Content>getContent(Content[] annotationContents, String[] classTypes, String[] methodTypes, Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Example>getExample(ExampleObject example)static Optional<Example>getExample(ExampleObject example, boolean ignoreName)static Map<String,Object>getExtensions(boolean openapi31, Extension... extensions)static Map<String,Object>getExtensions(Extension... extensions)static Optional<ExternalDocumentation>getExternalDocumentation(ExternalDocumentation externalDocumentation)static Optional<ExternalDocumentation>getExternalDocumentation(ExternalDocumentation externalDocumentation, boolean openapi31)static Optional<Header>getHeader(Header header, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Header>getHeader(Header header, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Header>getHeader(Header header, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Header>getHeader(Header header, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Map<String,Header>>getHeaders(Header[] annotationHeaders, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Map<String,Header>>getHeaders(Header[] annotationHeaders, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Map<String,Header>>getHeaders(Header[] annotationHeaders, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Map<String,Header>>getHeaders(Header[] annotationHeaders, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Info>getInfo(Info info)static Optional<Info>getInfo(Info info, boolean openapi31)static Optional<License>getLicense(License license)static Optional<License>getLicense(License license, boolean openapi31)static Optional<Link>getLink(Link link)static Optional<Link>getLink(Link link, boolean openapi31)static Map<String,String>getLinkParameters(LinkParameter[] linkParameter)static Map<String,Link>getLinks(Link[] links)static Map<String,Link>getLinks(Link[] links, boolean openapi31)static Optional<? extends Schema>getSchema(Content annotationContent, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<? extends Schema>getSchema(Content annotationContent, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<? extends Schema>getSchema(Schema schemaAnnotation, ArraySchema arrayAnnotation, boolean isArray, Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<? extends Schema>getSchema(Schema schemaAnnotation, ArraySchema arrayAnnotation, boolean isArray, Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static SchemagetSchemaAnnotation(com.fasterxml.jackson.databind.introspect.Annotated a)static SchemagetSchemaAnnotation(Annotation... annotations)static SchemagetSchemaAnnotation(Class<?> cls)static SchemagetSchemaDeclaredAnnotation(com.fasterxml.jackson.databind.introspect.Annotated a)static SchemagetSchemaDeclaredAnnotation(Class<?> cls)static Optional<Schema>getSchemaFromAnnotation(Schema schema, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Schema>getSchemaFromAnnotation(Schema schema, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Schema>getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static Optional<Schema>getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static Optional<Schema>getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema)static Optional<Schema>getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema, ModelConverterContext context)static Optional<Schema>getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema, Schema.SchemaResolution schemaResolution, ModelConverterContext context)static TypegetSchemaType(Schema schema)static TypegetSchemaType(Schema schema, boolean nullIfNotFound)static Optional<Server>getServer(Server server)static Optional<List<Server>>getServers(Server[] servers)static Optional<Set<Tag>>getTags(Tag[] tags, boolean skipOnlyName)static booleanhasArrayAnnotation(ArraySchema array)static booleanhasSchemaAnnotation(Schema schema)static ArraySchemamergeArraySchemaAnnotations(ArraySchema master, ArraySchema patch)static ArraySchemamergeArrayWithSchemaAnnotation(ArraySchema arraySchema, Schema schema)static SchemamergeSchemaAnnotations(Schema master, Schema patch)static AnnotationmergeSchemaAnnotations(Annotation[] ctxAnnotations, com.fasterxml.jackson.databind.JavaType type)static AnnotationmergeSchemaAnnotations(Annotation[] ctxAnnotations, com.fasterxml.jackson.databind.JavaType type, boolean contextWins)static Annotation[]removeAnnotations(Annotation[] annotations, Class... classes)static SchemaresolveSchemaFromType(Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)static SchemaresolveSchemaFromType(Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)static SchemaresolveSchemaFromType(Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema schemaAnnotation, ArraySchema arrayAnnotation, ModelConverterContext context)static Schema.SchemaResolutionresolveSchemaResolution(Schema.SchemaResolution globalSchemaResolution, Schema schemaAnnotation)static voidsetHeaderExplode(Header header, Header h)static voidupdateAnnotation(Class<?> clazz, Schema newAnnotation)
-
-
-
Field Detail
-
COMPONENTS_REF
public static final String COMPONENTS_REF
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasSchemaAnnotation
public static boolean hasSchemaAnnotation(Schema schema)
-
equals
public static boolean equals(Annotation thisAnnotation, Annotation thatAnnotation)
-
equals
public static boolean equals(ArraySchema thisArraySchema, ArraySchema thatArraySchema)
-
hasArrayAnnotation
public static boolean hasArrayAnnotation(ArraySchema array)
-
getExample
public static Optional<Example> getExample(ExampleObject example)
-
getExample
public static Optional<Example> getExample(ExampleObject example, boolean ignoreName)
-
getArraySchema
public static Optional<ArraySchema> getArraySchema(ArraySchema arraySchema, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getArraySchema
public static Optional<ArraySchema> getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getArraySchema
public static Optional<ArraySchema> getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getArraySchema
public static Optional<Schema> getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema)
-
getArraySchema
public static Optional<Schema> getArraySchema(ArraySchema arraySchema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema, boolean processSchemaImplementation)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema, ModelConverterContext context)
-
getSchemaFromAnnotation
public static Optional<Schema> getSchemaFromAnnotation(Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema existingSchema, Schema.SchemaResolution schemaResolution, ModelConverterContext context)
-
resolveSchemaFromType
public static Schema resolveSchemaFromType(Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
resolveSchemaFromType
public static Schema resolveSchemaFromType(Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
resolveSchemaFromType
public static Schema resolveSchemaFromType(Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31, Schema schemaAnnotation, ArraySchema arrayAnnotation, ModelConverterContext context)
-
getExternalDocumentation
public static Optional<ExternalDocumentation> getExternalDocumentation(ExternalDocumentation externalDocumentation)
-
getExternalDocumentation
public static Optional<ExternalDocumentation> getExternalDocumentation(ExternalDocumentation externalDocumentation, boolean openapi31)
-
getLinkParameters
public static Map<String,String> getLinkParameters(LinkParameter[] linkParameter)
-
getHeaders
public static Optional<Map<String,Header>> getHeaders(Header[] annotationHeaders, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getHeaders
public static Optional<Map<String,Header>> getHeaders(Header[] annotationHeaders, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getHeaders
public static Optional<Map<String,Header>> getHeaders(Header[] annotationHeaders, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getHeaders
public static Optional<Map<String,Header>> getHeaders(Header[] annotationHeaders, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getHeader
public static Optional<Header> getHeader(Header header, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getHeader
public static Optional<Header> getHeader(Header header, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getHeader
public static Optional<Header> getHeader(Header header, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getHeader
public static Optional<Header> getHeader(Header header, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
addEncodingToMediaType
public static void addEncodingToMediaType(MediaType mediaType, Encoding encoding, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
addEncodingToMediaType
public static void addEncodingToMediaType(MediaType mediaType, Encoding encoding, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getContent
public static Optional<Content> getContent(Content[] annotationContents, String[] classTypes, String[] methodTypes, Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getContent
public static Optional<Content> getContent(Content[] annotationContents, String[] classTypes, String[] methodTypes, Schema schema, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getSchema
public static Optional<? extends Schema> getSchema(Content annotationContent, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getSchema
public static Optional<? extends Schema> getSchema(Content annotationContent, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
getSchema
public static Optional<? extends Schema> getSchema(Schema schemaAnnotation, ArraySchema arrayAnnotation, boolean isArray, Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation)
-
getSchema
public static Optional<? extends Schema> getSchema(Schema schemaAnnotation, ArraySchema arrayAnnotation, boolean isArray, Class<?> schemaImplementation, Components components, com.fasterxml.jackson.annotation.JsonView jsonViewAnnotation, boolean openapi31)
-
applyTypes
public static void applyTypes(String[] classTypes, String[] methodTypes, Content content, MediaType mediaType)
-
getSchemaAnnotation
public static Schema getSchemaAnnotation(com.fasterxml.jackson.databind.introspect.Annotated a)
-
getSchemaDeclaredAnnotation
public static Schema getSchemaDeclaredAnnotation(com.fasterxml.jackson.databind.introspect.Annotated a)
-
getExtensions
public static Map<String,Object> getExtensions(boolean openapi31, Extension... extensions)
-
getSchemaAnnotation
public static Schema getSchemaAnnotation(Annotation... annotations)
-
getArraySchemaAnnotation
public static ArraySchema getArraySchemaAnnotation(Annotation... annotations)
-
getAnnotation
public static <T> T getAnnotation(Class<T> cls, Annotation... annotations)
-
removeAnnotations
public static Annotation[] removeAnnotations(Annotation[] annotations, Class... classes)
-
mergeSchemaAnnotations
public static Annotation mergeSchemaAnnotations(Annotation[] ctxAnnotations, com.fasterxml.jackson.databind.JavaType type)
-
mergeSchemaAnnotations
public static Annotation mergeSchemaAnnotations(Annotation[] ctxAnnotations, com.fasterxml.jackson.databind.JavaType type, boolean contextWins)
-
mergeArraySchemaAnnotations
public static ArraySchema mergeArraySchemaAnnotations(ArraySchema master, ArraySchema patch)
-
mergeArrayWithSchemaAnnotation
public static ArraySchema mergeArrayWithSchemaAnnotation(ArraySchema arraySchema, Schema schema)
-
resolveSchemaResolution
public static Schema.SchemaResolution resolveSchemaResolution(Schema.SchemaResolution globalSchemaResolution, Schema schemaAnnotation)
-
-