functions.OpenAPISpecification.ext Maven / Gradle / Ivy
import uml;
import JMM;
extension java::GeneratorCommons;
extension functions::SystemProperties;
cached boolean isOpenAPISpecification(uml::Element element):
element.isStereotypeApplied("OpenAPI3Specification");
cached OpenAPI3Specification asOpenAPISpecification(uml::Element element):
(OpenAPI3Specification) element;
cached String getContactName(OpenAPI3Specification spec):
if spec.contactName.length > 0
then spec.contactName
else getOpenAPIContactNameFromSystemProperties();
cached String getContactURL(OpenAPI3Specification spec):
if spec.contactURL.length > 0
then spec.contactURL
else getOpenAPIContactURLFromSystemProperties();
cached String getContactEmail(OpenAPI3Specification spec):
if spec.contactEmail.length > 0
then spec.contactEmail
else getOpenAPIContactEmailFromSystemProperties();
cached String getLicenseName(OpenAPI3Specification spec):
if spec.licenseName.length > 0
then spec.licenseName
else getOpenAPILicenseNameFromSystemProperties();
cached String getLicenseURL(OpenAPI3Specification spec):
if spec.licenseURL.length > 0
then spec.licenseURL
else getOpenAPILicenseURLFromSystemProperties();
cached String getTermsOfUseURL(OpenAPI3Specification spec):
if spec.termsOfUseURL.length > 0
then spec.termsOfUseURL
else getOpenAPITermsOfUseURLFromSystemProperties();
private cached String getOpenAPIContactNameFromSystemProperties():
getSystemProperty("switch.gen.openapi.openAPIContactName", "");
private cached String getOpenAPIContactURLFromSystemProperties():
getSystemProperty("switch.gen.openapi.openAPIContactURL", "");
private cached String getOpenAPIContactEmailFromSystemProperties():
getSystemProperty("switch.gen.openapi.openAPIContactEmail", "");
private cached String getOpenAPILicenseNameFromSystemProperties():
getSystemProperty("switch.gen.openapi.openAPILicenseName", "");
private cached String getOpenAPILicenseURLFromSystemProperties():
getSystemProperty("switch.gen.openapi.openAPILicenseURL", "");
private cached String getOpenAPITermsOfUseURLFromSystemProperties():
getSystemProperty("switch.gen.openapi.openAPITermsOfUseURL", "");
cached boolean hasDependency(OpenAPI3Specification source, OpenAPI3Specification target):
source.getDependentOpenAPISpecs().contains(target);
cached List[OpenAPI3Specification] getDependentOpenAPISpecs(OpenAPI3Specification source):
source.getRelationships().typeSelect(Dependency).supplier.typeSelect(OpenAPI3Specification);
cached boolean runOpenAPIDependencyCheck():
getBooleanSystemProperty("switch.gen.openapi.checkOpenAPIDependencies", true);