use of org.ballerinalang.swagger.code.generator.model.Organization in project ballerina by ballerina-lang.
the class SwaggerServiceMapper method createOrganizationModel.
/**
* Creates vendor extension for organization.
* @param annotationAttributeValue The annotation attribute value for organization vendor extension.
* @param info The info definition.
*/
private void createOrganizationModel(AnnAttributeValue annotationAttributeValue, Info info) {
if (null != annotationAttributeValue) {
AnnAttachmentInfo organizationAnnotationAttachment = annotationAttributeValue.getAnnotationAttachmentValue();
Organization organization = new Organization();
for (AnnAttributeKeyValuePair annAttributeKeyValuePair : organizationAnnotationAttachment.getAttributeKeyValuePairs()) {
if ("name".equals(annAttributeKeyValuePair.getAttributeName())) {
organization.setName(annAttributeKeyValuePair.getAttributeValue().getStringValue());
} else if ("url".equals(annAttributeKeyValuePair.getAttributeName())) {
organization.setUrl(annAttributeKeyValuePair.getAttributeValue().getStringValue());
}
}
info.setVendorExtension("x-organization", organization);
}
}
Aggregations