use of org.ballerinalang.ballerina.swagger.convertor.service.model.Developer in project ballerina by ballerina-lang.
the class SwaggerServiceMapper method createDevelopersModel.
/**
* Creates vendor extension for developers.
* @param annotationAttributeValue The annotation attribute value for developer vendor extension.
* @param info The info definition.
*/
private void createDevelopersModel(AnnotationAttachmentAttributeValueNode annotationAttributeValue, Info info) {
if (null != annotationAttributeValue) {
List<Developer> developers = new LinkedList<>();
for (AnnotationAttachmentAttributeValueNode value : annotationAttributeValue.getValueArray()) {
AnnotationAttachmentNode developerAnnotation = (AnnotationAttachmentNode) value.getValue();
Map<String, AnnotationAttachmentAttributeValueNode> developerAttributes = this.listToMap(developerAnnotation);
Developer developer = new Developer();
if (developerAttributes.containsKey("name")) {
developer.setName(this.getStringLiteralValue(developerAttributes.get("name")));
}
if (developerAttributes.containsKey("email")) {
developer.setEmail(this.getStringLiteralValue(developerAttributes.get("email")));
}
developers.add(developer);
}
info.setVendorExtension("x-developers", Lists.reverse(developers));
}
}
Aggregations