Search in sources :

Example 1 with ClassType

use of org.jboss.jandex.ClassType in project wildfly-swarm by wildfly-swarm.

the class OpenApiAnnotationScanner method readClassSchema.

/**
 * Introspect into the given Class to generate a Schema model.
 * @param value
 */
private Schema readClassSchema(AnnotationValue value, boolean schemaReferenceSupported) {
    if (value == null) {
        return null;
    }
    ClassType ctype = (ClassType) value.asClass();
    Schema schema = introspectClassToSchema(ctype, schemaReferenceSupported);
    return schema;
}
Also used : Schema(org.eclipse.microprofile.openapi.models.media.Schema) ClassType(org.jboss.jandex.ClassType)

Example 2 with ClassType

use of org.jboss.jandex.ClassType in project wildfly-swarm by wildfly-swarm.

the class OpenApiAnnotationScanner method readClassSchemas.

/**
 * Reads an array of Class annotations to produce a list of {@link Schema} models.
 * @param value
 */
private List<Schema> readClassSchemas(AnnotationValue value) {
    if (value == null) {
        return null;
    }
    LOG.debug("Processing a list of schema Class annotations.");
    Type[] classArray = value.asClassArray();
    List<Schema> schemas = new ArrayList<>(classArray.length);
    for (Type type : classArray) {
        ClassType ctype = (ClassType) type;
        Schema schema = introspectClassToSchema(ctype, true);
        schemas.add(schema);
    }
    return schemas;
}
Also used : ClassType(org.jboss.jandex.ClassType) RefType(org.wildfly.swarm.microprofile.openapi.runtime.util.JandexUtil.RefType) MediaType(org.eclipse.microprofile.openapi.models.media.MediaType) Type(org.jboss.jandex.Type) Schema(org.eclipse.microprofile.openapi.models.media.Schema) ArrayList(java.util.ArrayList) ClassType(org.jboss.jandex.ClassType)

Example 3 with ClassType

use of org.jboss.jandex.ClassType in project wildfly-swarm by wildfly-swarm.

the class SchemaFactory method readClassSchemas.

private static List<Schema> readClassSchemas(IndexView index, AnnotationValue value) {
    if (value == null) {
        return null;
    }
    Type[] classArray = value.asClassArray();
    List<Schema> schemas = new ArrayList<>(classArray.length);
    for (Type type : classArray) {
        ClassType ctype = (ClassType) type;
        Schema schema = introspectClassToSchema(index, ctype);
        schemas.add(schema);
    }
    return schemas;
}
Also used : Type(org.jboss.jandex.Type) ClassType(org.jboss.jandex.ClassType) Schema(org.eclipse.microprofile.openapi.models.media.Schema) ArrayList(java.util.ArrayList) ClassType(org.jboss.jandex.ClassType)

Aggregations

Schema (org.eclipse.microprofile.openapi.models.media.Schema)3 ClassType (org.jboss.jandex.ClassType)3 ArrayList (java.util.ArrayList)2 Type (org.jboss.jandex.Type)2 MediaType (org.eclipse.microprofile.openapi.models.media.MediaType)1 RefType (org.wildfly.swarm.microprofile.openapi.runtime.util.JandexUtil.RefType)1