Class SchemaFactory

    • Method Detail

      • readSchema

        public static org.eclipse.microprofile.openapi.models.media.Schema readSchema​(AnnotationScannerContext context,
                                                                                      org.jboss.jandex.AnnotationValue value)
        Reads a Schema annotation into a model.
        Parameters:
        context - scanning context
        value - the annotation value
        Returns:
        Schema model
      • readSchema

        public static org.eclipse.microprofile.openapi.models.media.Schema readSchema​(AnnotationScannerContext context,
                                                                                      org.jboss.jandex.AnnotationInstance schemaAnnotation)
        Reads a Schema annotation into a model.
        Parameters:
        context - scanning context
        schemaAnnotation - the @Schema annotation
        Returns:
        Schema model
      • readSchema

        public static org.eclipse.microprofile.openapi.models.media.Schema readSchema​(AnnotationScannerContext context,
                                                                                      org.eclipse.microprofile.openapi.models.media.Schema schema,
                                                                                      org.jboss.jandex.AnnotationInstance annotation,
                                                                                      org.jboss.jandex.ClassInfo clazz)
        Populates the schema using the @Schema on the provided class. If the schema has already been registered (in components), the existing registration will be replaced.
        Parameters:
        context - scanning context
        schema - schema model to populate
        annotation - schema annotation to read
        clazz - the class annotated with @Schema
        Returns:
        the schema, possibly replaced if implementation has been specified in the annotation
      • readSchema

        public static org.eclipse.microprofile.openapi.models.media.Schema readSchema​(AnnotationScannerContext context,
                                                                                      org.eclipse.microprofile.openapi.models.media.Schema schema,
                                                                                      org.jboss.jandex.AnnotationInstance annotation,
                                                                                      Map<String,​Object> defaults)
      • typeToSchema

        public static org.eclipse.microprofile.openapi.models.media.Schema typeToSchema​(AnnotationScannerContext context,
                                                                                        org.jboss.jandex.Type type,
                                                                                        List<AnnotationScannerExtension> extensions)
        Converts a Jandex type to a Schema model.
        Parameters:
        context - scanning context
        type - the implementation type of the item to scan
        extensions - list of AnnotationScannerExtensions
        Returns:
        Schema model
      • enumToSchema

        public static org.eclipse.microprofile.openapi.models.media.Schema enumToSchema​(AnnotationScannerContext context,
                                                                                        org.jboss.jandex.Type enumType)
        Convert a Jandex enum class type to a Schema model.Adds each enum constant name to the list of the given schema's enumeration list. The given type must be found in the index.
        Parameters:
        context - scanning context
        enumType - type containing Java Enum constants
        Returns:
        Schema model
        See Also:
        Field.isEnumConstant()
      • schemaRegistration

        public static org.eclipse.microprofile.openapi.models.media.Schema schemaRegistration​(AnnotationScannerContext context,
                                                                                              org.jboss.jandex.Type type,
                                                                                              org.eclipse.microprofile.openapi.models.media.Schema schema)
        Register the provided schema in the SchemaRegistry if allowed.
        Parameters:
        context - scanning context
        type - the type of the schema to register
        schema - a schema
        Returns:
        a reference to the registered schema or the input schema when registration is not allowed/possible