use of org.ballerinalang.swagger.code.generator.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(AnnAttributeValue annotationAttributeValue, Info info) {
if (null != annotationAttributeValue && annotationAttributeValue.getAttributeValueArray().length > 0) {
Developer[] developers = new Developer[annotationAttributeValue.getAttributeValueArray().length];
for (int i = 0; i < annotationAttributeValue.getAttributeValueArray().length; i++) {
AnnAttachmentInfo developerAnnotation = annotationAttributeValue.getAttributeValueArray()[i].getAnnotationAttachmentValue();
Developer developer = new Developer();
for (AnnAttributeKeyValuePair annAttributeKeyValuePair : developerAnnotation.getAttributeKeyValuePairs()) {
if ("name".equals(annAttributeKeyValuePair.getAttributeName())) {
developer.setName(annAttributeKeyValuePair.getAttributeValue().getStringValue());
} else if ("email".equals(annAttributeKeyValuePair.getAttributeName())) {
developer.setEmail(annAttributeKeyValuePair.getAttributeValue().getStringValue());
}
}
developers[i] = developer;
}
info.setVendorExtension("x-developers", developers);
}
}
Aggregations