use of org.wildfly.swarm.microprofile.openapi.api.models.media.DiscriminatorImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiParser method readDiscriminator.
/**
* Reads a {@link Discriminator} OpenAPI node.
* @param node
*/
private Discriminator readDiscriminator(JsonNode node) {
if (node == null || !node.isObject()) {
return null;
}
DiscriminatorImpl model = new DiscriminatorImpl();
model.setPropertyName(JsonUtil.stringProperty(node, OpenApiConstants.PROP_PROPERTY_NAME));
model.setMapping(readStringMap(node.get(OpenApiConstants.PROP_MAPPING)));
return model;
}
use of org.wildfly.swarm.microprofile.openapi.api.models.media.DiscriminatorImpl in project wildfly-swarm by wildfly-swarm.
the class OpenApiAnnotationScanner method readDiscriminatorMappings.
/**
* Reads an array of DiscriminatorMapping annotations into a {@link Discriminator} model.
* @param value
*/
private Discriminator readDiscriminatorMappings(AnnotationValue value) {
if (value == null) {
return null;
}
LOG.debug("Processing a list of @DiscriminatorMapping annotations.");
Discriminator discriminator = new DiscriminatorImpl();
AnnotationInstance[] nestedArray = value.asNestedArray();
for (@SuppressWarnings("unused") AnnotationInstance nested : nestedArray) {
// TODO iterate the discriminator mappings and do something sensible with them! :(
}
return discriminator;
}
Aggregations