Search in sources :

Example 1 with ExternalDocumentationImpl

use of org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl in project wildfly-swarm by wildfly-swarm.

the class OpenApiParser method readExternalDocs.

/**
 * Reads an {@link ExternalDocumentation} OpenAPI node.
 * @param node
 */
private ExternalDocumentation readExternalDocs(JsonNode node) {
    if (node == null) {
        return null;
    }
    ExternalDocumentationImpl model = new ExternalDocumentationImpl();
    model.setDescription(JsonUtil.stringProperty(node, OpenApiConstants.PROP_DESCRIPTION));
    model.setUrl(JsonUtil.stringProperty(node, OpenApiConstants.PROP_URL));
    readExtensions(node, model);
    return model;
}
Also used : ExternalDocumentationImpl(org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl)

Example 2 with ExternalDocumentationImpl

use of org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl in project wildfly-swarm by wildfly-swarm.

the class OpenApiAnnotationScanner method readExternalDocs.

/**
 * Reads an ExternalDocumentation annotation.
 * @param externalDocAnno
 */
private ExternalDocumentation readExternalDocs(AnnotationValue externalDocAnno) {
    if (externalDocAnno == null) {
        return null;
    }
    LOG.debug("Processing an @ExternalDocumentation annotation.");
    AnnotationInstance nested = externalDocAnno.asNested();
    ExternalDocumentation externalDoc = new ExternalDocumentationImpl();
    externalDoc.setDescription(JandexUtil.stringValue(nested, OpenApiConstants.PROP_DESCRIPTION));
    externalDoc.setUrl(JandexUtil.stringValue(nested, OpenApiConstants.PROP_URL));
    return externalDoc;
}
Also used : ExternalDocumentationImpl(org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl) ExternalDocumentation(org.eclipse.microprofile.openapi.models.ExternalDocumentation) AnnotationInstance(org.jboss.jandex.AnnotationInstance)

Example 3 with ExternalDocumentationImpl

use of org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl in project wildfly-swarm by wildfly-swarm.

the class SchemaFactory method readExternalDocs.

private static ExternalDocumentation readExternalDocs(AnnotationValue externalDocAnno) {
    if (externalDocAnno == null) {
        return null;
    }
    AnnotationInstance nested = externalDocAnno.asNested();
    ExternalDocumentation externalDoc = new ExternalDocumentationImpl();
    externalDoc.setDescription(JandexUtil.stringValue(nested, OpenApiConstants.PROP_DESCRIPTION));
    externalDoc.setUrl(JandexUtil.stringValue(nested, OpenApiConstants.PROP_URL));
    return externalDoc;
}
Also used : ExternalDocumentationImpl(org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl) ExternalDocumentation(org.eclipse.microprofile.openapi.models.ExternalDocumentation) AnnotationInstance(org.jboss.jandex.AnnotationInstance)

Aggregations

ExternalDocumentationImpl (org.wildfly.swarm.microprofile.openapi.api.models.ExternalDocumentationImpl)3 ExternalDocumentation (org.eclipse.microprofile.openapi.models.ExternalDocumentation)2 AnnotationInstance (org.jboss.jandex.AnnotationInstance)2