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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    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
    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
    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, getHeader, getHeader, getHeaders, getHeaders, 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, setHeaderExplode, updateAnnotation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 implementation
      components - the components
      jsonView - the json view
      annotations - the annotations
      specVersion - 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 components
      returnType - the return type
      jsonView - the json view
      annotations - the annotations
      specVersion - 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 contents
      classTypes - the class types
      methodTypes - the method types
      schema - the schema
      components - the components
      jsonViewAnnotation - the json view annotation
      openapi31 - 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 content
      schemaN - the schema n
      mediaTypeStr - 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
    • resolveDefaultValue

      public static Object resolveDefaultValue(String defaultValueStr, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Resolve default value object.
      Parameters:
      defaultValueStr - the default value str
      objectMapper - the object mapper
      Returns:
      the object