Class 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
    • 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
    • Constructor Detail

      • SpringDocAnnotationsUtils

        public SpringDocAnnotationsUtils()
    • 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 implementation
        components - the components
        jsonView - the json view
        annotations - 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 components
        returnType - the return type
        jsonView - the json view
        annotations - 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 contents
        classTypes - the class types
        methodTypes - the method types
        schema - the schema
        components - the components
        jsonViewAnnotation - 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 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)