use of org.wildfly.swarm.microprofile.openapi.api.models.media.EncodingImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiParser method readEncoding.
/**
* Reads a {@link Encoding} OpenAPI node.
* @param node
*/
private Encoding readEncoding(JsonNode node) {
if (node == null || !node.isObject()) {
return null;
}
EncodingImpl model = new EncodingImpl();
model.setContentType(JsonUtil.stringProperty(node, OpenApiConstants.PROP_CONTENT_TYPE));
model.setHeaders(readHeaders(node.get(OpenApiConstants.PROP_HEADERS)));
model.setStyle(readEncodingStyle(node.get(OpenApiConstants.PROP_STYLE)));
model.setExplode(JsonUtil.booleanProperty(node, OpenApiConstants.PROP_EXPLODE));
model.setAllowReserved(JsonUtil.booleanProperty(node, OpenApiConstants.PROP_ALLOW_RESERVED));
readExtensions(node, model);
return model;
}
use of org.wildfly.swarm.microprofile.openapi.api.models.media.EncodingImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiAnnotationScanner method readEncoding.
/**
* Reads a single Encoding annotation into a model.
* @param annotation
*/
private Encoding readEncoding(AnnotationInstance annotation) {
if (annotation == null) {
return null;
}
LOG.debug("Processing a single @Encoding annotation.");
Encoding encoding = new EncodingImpl();
encoding.setContentType(JandexUtil.stringValue(annotation, OpenApiConstants.PROP_CONTENT_TYPE));
encoding.setStyle(JandexUtil.enumValue(annotation, OpenApiConstants.PROP_STYLE, org.eclipse.microprofile.openapi.models.media.Encoding.Style.class));
encoding.setExplode(JandexUtil.booleanValue(annotation, OpenApiConstants.PROP_EXPLODE));
encoding.setAllowReserved(JandexUtil.booleanValue(annotation, OpenApiConstants.PROP_ALLOW_RESERVED));
encoding.setHeaders(readHeaders(annotation.value(OpenApiConstants.PROP_HEADERS)));
return encoding;
}
Aggregations