public Info termsOfService(String termsOfService) { this.setTermsOfService(termsOfService); return this; }
private void convertInfo(io.swagger.annotations.Info infoAnnotation, Swagger swagger) { if (infoAnnotation == null) { return; } Info info = new Info(); info.setTitle(infoAnnotation.title()); info.setVersion(infoAnnotation.version()); info.setDescription(infoAnnotation.description()); info.setTermsOfService(infoAnnotation.termsOfService()); info.setContact(convertContact(infoAnnotation.contact())); info.setLicense(convertLicense(infoAnnotation.license())); info.getVendorExtensions().putAll(BaseReaderUtils.parseExtensions(infoAnnotation.extensions())); swagger.setInfo(info); }
private void convertInfo(io.swagger.annotations.Info infoAnnotation, Swagger swagger) { if (infoAnnotation == null) { return; } Info info = new Info(); info.setTitle(infoAnnotation.title()); info.setVersion(infoAnnotation.version()); info.setDescription(infoAnnotation.description()); info.setTermsOfService(infoAnnotation.termsOfService()); info.setContact(convertContact(infoAnnotation.contact())); info.setLicense(convertLicense(infoAnnotation.license())); info.getVendorExtensions().putAll(BaseReaderUtils.parseExtensions(infoAnnotation.extensions())); swagger.setInfo(info); }
info.setTermsOfService(infoConfig.termsOfService());
info.setTermsOfService(infoConfig.termsOfService());
info.setTermsOfService(infoConfig.termsOfService());
info.setTermsOfService(infoConfig.termsOfService());
info.setTermsOfService(infoConfig.termsOfService());
info.setTermsOfService(infoConfig.termsOfService());
private Info getSwaggerInfo(Swagger swagger){ Info info = swagger.getInfo(); if(info ==null)info = new Info(); Contact contact = getSwaggerContact(); License license = getSwaggerLicense(); String title = whiteLabel.getProperty(INFO_TITLE, null); String description = whiteLabel.getProperty(INFO_DESC, null); String version = whiteLabel.getProperty(INFO_VERSION, null); String terms = whiteLabel.getProperty(INFO_TERMS, null); if(anyIsSet(title,description,version,terms) || contact!=null || license!=null){ if(anyIsSet(title))info.setTitle(title); if(anyIsSet(description))info.setDescription(description); if(anyIsSet(version))info.setVersion(version); if(anyIsSet(terms))info.setTermsOfService(terms); if(contact!=null)info.setContact(contact); if(license!=null)info.setLicense(license); return info; } return null; }
private void updateInfoFromConfig() { if (getSwagger().getInfo() == null) { setInfo(new Info()); } if (StringUtils.isNotBlank(getDescription())) { getSwagger().getInfo().setDescription(getDescription()); } if (StringUtils.isNotBlank(getTitle())) { getSwagger().getInfo().setTitle(getTitle()); } if (StringUtils.isNotBlank(getVersion())) { getSwagger().getInfo().setVersion(getVersion()); } if (StringUtils.isNotBlank(getTermsOfServiceUrl())) { getSwagger().getInfo().setTermsOfService(getTermsOfServiceUrl()); } if (getContact() != null) { getSwagger().getInfo().setContact((new Contact()).name(getContact())); } if (getLicense() != null && getLicenseUrl() != null) { getSwagger().getInfo().setLicense((new License()).name(getLicense()).url(getLicenseUrl())); } if (getSchemes() != null) { for (String scheme : getSchemes()) { reader.getSwagger().scheme(Scheme.forValue(scheme)); } } reader.getSwagger().setInfo(getInfo()); }
private void updateInfoFromConfig() { if (getSwagger().getInfo() == null) { setInfo(new Info()); } if (StringUtils.isNotBlank(getDescription())) { getSwagger().getInfo().setDescription(getDescription()); } if (StringUtils.isNotBlank(getTitle())) { getSwagger().getInfo().setTitle(getTitle()); } if (StringUtils.isNotBlank(getVersion())) { getSwagger().getInfo().setVersion(getVersion()); } if (StringUtils.isNotBlank(getTermsOfServiceUrl())) { getSwagger().getInfo().setTermsOfService(getTermsOfServiceUrl()); } if (getContact() != null) { getSwagger().getInfo().setContact((new Contact()).name(getContact())); } if (getLicense() != null && getLicenseUrl() != null) { getSwagger().getInfo().setLicense((new License()).name(getLicense()).url(getLicenseUrl())); } if (getSchemes() != null) { for (String scheme : getSchemes()) { reader.getSwagger().scheme(Scheme.forValue(scheme)); } } reader.getSwagger().setInfo(getInfo()); }
}); getConfigurationProperty(configurationProperties.getTermsOfServiceUrl()).ifPresent(v -> { info.setTermsOfService(v); }); getConfigurationProperty(configurationProperties.getLicenseName()).ifPresent(v -> { info.setTermsOfService(v); });
public void init() { if (!config.isConfigOk()) { return; } swagger = new Swagger(); swagger.setHost(config.getHost()); swagger.setBasePath("/"); swagger.addScheme(HTTP); swagger.addScheme(HTTPS); Info swaggerInfo = new Info(); swaggerInfo.setDescription(config.getDescription()); swaggerInfo.setVersion(config.getVersion()); swaggerInfo.setTitle(config.getTitle()); swaggerInfo.setTermsOfService(config.getTermsOfService()); Contact contact = new Contact(); contact.setName(config.getContactName()); contact.setEmail(config.getContactEmail()); contact.setUrl(config.getContactUrl()); swaggerInfo.setContact(contact); License license = new License(); license.setName(config.getLicenseName()); license.setUrl(config.getLicenseUrl()); swaggerInfo.setLicense(license); swagger.setInfo(swaggerInfo); List<Class> classes = ClassScanner.scanClassByAnnotation(RequestMapping.class, false); Reader.read(swagger, classes); }