/** * The info will be used only if there is no @OpenAPIDefinition annotation is present. */ private Info getInfo(final Properties properties) { final Info info = new Info() .title(getOrFallback(getTitle(), properties, TITLE_PROPERTY)) .version(getOrFallback(getVersion(), properties, VERSION_PROPERTY)) .description(getOrFallback(getDescription(), properties, DESCRIPTION_PROPERTY)) .termsOfService(getOrFallback(getTermsOfServiceUrl(), properties, TERMS_URL_PROPERTY)) .contact(new Contact() .name(getOrFallback(getContactName(), properties, CONTACT_PROPERTY)) .email(getContactEmail()) .url(getContactUrl())) .license(new License() .name(getOrFallback(getLicense(), properties, LICENSE_PROPERTY)) .url(getOrFallback(getLicenseUrl(), properties, LICENSE_URL_PROPERTY))); if (info.getLicense().getName() == null) { info.getLicense().setName(DEFAULT_LICENSE_VALUE); } if (info.getLicense().getUrl() == null && DEFAULT_LICENSE_VALUE.equals(info.getLicense().getName())) { info.getLicense().setUrl(DEFAULT_LICENSE_URL); } return info; }
/** * The info will be used only if there is no @OpenAPIDefinition annotation is present. */ private Info getInfo(final Properties properties) { final Info info = new Info() .title(getOrFallback(getTitle(), properties, TITLE_PROPERTY)) .version(getOrFallback(getVersion(), properties, VERSION_PROPERTY)) .description(getOrFallback(getDescription(), properties, DESCRIPTION_PROPERTY)) .termsOfService(getOrFallback(getTermsOfServiceUrl(), properties, TERMS_URL_PROPERTY)) .contact(new Contact() .name(getOrFallback(getContactName(), properties, CONTACT_PROPERTY)) .email(getContactEmail()) .url(getContactUrl())) .license(new License() .name(getOrFallback(getLicense(), properties, LICENSE_PROPERTY)) .url(getOrFallback(getLicenseUrl(), properties, LICENSE_URL_PROPERTY))); if (info.getLicense().getName() == null) { info.getLicense().setName(DEFAULT_LICENSE_VALUE); } if (info.getLicense().getUrl() == null && DEFAULT_LICENSE_VALUE.equals(info.getLicense().getName())) { info.getLicense().setUrl(DEFAULT_LICENSE_URL); } return info; }