private void correctInfo() { Info info = swagger.getInfo(); if (info == null) { info = new Info(); swagger.setInfo(info); } if (StringUtils.isEmpty(info.getTitle())) { info.setTitle("swagger definition for " + cls.getName()); } if (StringUtils.isEmpty(info.getVersion())) { info.setVersion("1.0.0"); } setJavaInterface(info, cls); }
public Info version(String version) { this.setVersion(version); 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 Info getInfo() { Info info = new Info(); // version in general refers to major version of the project (kie server) though it uses minor as well to allow emergency type of changesinfo.setTitle("KIE-Server API"); // must be updated with every major release info.setVersion("7.0"); info.setTitle("KIE Server"); return info; }
private void correctInfo() { Info info = swagger.getInfo(); if (info == null) { info = new Info(); swagger.setInfo(info); } if (StringUtils.isEmpty(info.getTitle())) { info.setTitle("swagger definition for " + cls.getName()); } if (StringUtils.isEmpty(info.getVersion())) { info.setVersion("1.0.0"); } setJavaInterface(info, cls); }
protected void applyDefaultVersion(Swagger data) { if (applyDefaultVersion && data.getInfo() != null && data.getInfo().getVersion() == null && beanConfig != null && beanConfig.getResourcePackage() != null) { Package resourcePackage = Package.getPackage(beanConfig.getResourcePackage()); if (resourcePackage != null) { data.getInfo().setVersion(resourcePackage.getImplementationVersion()); } } }
private Info getInfo() { Info info = new Info(); Contact contact = new Contact(); contact.setName(serviceTemplate.getMetadata().get(BluePrintConstants.METADATA_TEMPLATE_AUTHOR)); info.setContact(contact); info.setTitle(serviceTemplate.getMetadata().get(BluePrintConstants.METADATA_TEMPLATE_NAME)); info.setDescription(serviceTemplate.getDescription()); info.setVersion(serviceTemplate.getMetadata().get(BluePrintConstants.METADATA_TEMPLATE_VERSION)); return info; }
@Override public Swagger configure(Swagger swagger) { ApplicationConfig application = ReferenceManager.getInstance().getApplication(); if (null != application) { Info info = swagger.getInfo(); if (info == null) { info = new Info(); swagger.setInfo(info); } info.setTitle(application.getName()); version = StringUtils.isNotBlank(version) ? version : application.getVersion(); if (StringUtils.isNotBlank(groupId) && StringUtils.isNotBlank(artifactId) && StringUtils.isNotBlank(version)){ info.setDescription(MessageFormat.format(mavenDependency, groupId, artifactId, version)); } info.setVersion(StringUtils.isNotBlank(version) ? version : ""); Contact contact = new Contact(); info.setContact(contact); contact.setName(application.getOwner()); } setBashPath(swagger); return swagger; }
info.setDescription(api.getDescription()); info.setVersion(api.getVersion()); swagger.setInfo(info); Map<String, Path> stringPathMap = new HashMap();
info.setDescription(api.getDescription()); info.setVersion(api.getVersion()); swagger.setInfo(info); Map<String, Path> stringPathMap = new HashMap();
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.setVersion(infoConfig.version());
info.setVersion(infoConfig.version());
info.setVersion(infoConfig.version());
info.setVersion(infoConfig.version());
info.setVersion(infoConfig.version());
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()); }
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); }