Java Code Examples for io.swagger.models.Info#setTitle()
The following examples show how to use
io.swagger.models.Info#setTitle() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApiDocConfig.java From ambari-logsearch with Apache License 2.0 | 8 votes |
@Bean public BeanConfig swaggerConfig() { BeanConfig beanConfig = new BeanConfig(); beanConfig.setSchemes(new String[]{"http", "https"}); beanConfig.setBasePath(BASE_PATH); beanConfig.setTitle(TITLE); beanConfig.setDescription(DESCRIPTION); beanConfig.setLicense(LICENSE); beanConfig.setLicenseUrl(LICENSE_URL); beanConfig.setScan(true); beanConfig.setVersion(VERSION); beanConfig.setResourcePackage(ServiceLogsResource.class.getPackage().getName()); License license = new License(); license.setName(LICENSE); license.setUrl(LICENSE_URL); Info info = new Info(); info.setDescription(DESCRIPTION); info.setTitle(TITLE); info.setVersion(VERSION); info.setLicense(license); beanConfig.setInfo(info); return beanConfig; }
Example 2
Source File: SpringTimeSwaggerDocsController.java From springtime with Apache License 2.0 | 6 votes |
@Override public void afterPropertiesSet() throws Exception { swagger = new Swagger(); Info info = new Info(); info.setTitle("GreetingService"); swagger.setInfo(info); Map<String, Object> beans = applicationContext.getBeansWithAnnotation(SpringTimeService.class); Set<Class<?>> classes = new HashSet<Class<?>>(); for (Object bean : beans.values()) { classes.add(bean.getClass()); } Reader reader = new Reader(swagger, ReaderConfigUtils.getReaderConfig(null)); swagger = reader.read(classes); }
Example 3
Source File: ServiceCombDocumentationSwaggerMapper.java From spring-cloud-huawei with Apache License 2.0 | 5 votes |
private void changeSwaggerInfo(String originalSchemaId, Swagger swagger) { String fullClassName = DefinitionCache.getFullClassNameBySchema(originalSchemaId); String xInterfaceName = genXInterfaceName(appName, serviceName, mapSchemaId(originalSchemaId)); Info info = swagger.getInfo(); info.setTitle(TITLE_PREFIX + fullClassName); info.setVendorExtension(X_JAVA_INTERFACE, xInterfaceName); }
Example 4
Source File: OpenAPIV2GeneratorTest.java From spring-openapi with MIT License | 5 votes |
private Info createTestInfo() { Info info = new Info(); info.setTitle("Test API"); info.setDescription("Test description"); info.setVersion("1.0.0"); return info; }
Example 5
Source File: UpdateManager.java From cellery-distribution with Apache License 2.0 | 5 votes |
/** * Creates Swagger Info * * @param api API sent by controller * @return Swagger Info */ private static Info createSwaggerInfo(API api) { Info info = new Info(); info.setVersion(cellConfig.getVersion()); info.setTitle(generateAPIName(api)); return info; }
Example 6
Source File: StaticHtmlGenerator.java From TypeScript-Microservices with MIT License | 5 votes |
public void preprocessSwagger(Swagger swagger) { Info info = swagger.getInfo(); info.setDescription(toHtml(info.getDescription())); info.setTitle(toHtml(info.getTitle())); Map<String, Model> models = swagger.getDefinitions(); for (Model model : models.values()) { model.setDescription(toHtml(model.getDescription())); model.setTitle(toHtml(model.getTitle())); } }
Example 7
Source File: SwaggerService.java From heimdall with Apache License 2.0 | 5 votes |
private Info getInfoByApi(Api api) { Info info = new Info(); info.setTitle(api.getName()); info.setDescription(api.getDescription()); info.setVersion(api.getVersion()); return info; }
Example 8
Source File: JbootSwaggerManager.java From jboot with Apache License 2.0 | 5 votes |
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); }
Example 9
Source File: OAS2Parser.java From carbon-apimgt with Apache License 2.0 | 5 votes |
/** * This method generates API definition to the given api * * @param swaggerData api * @return API definition in string format * @throws APIManagementException */ @Override public String generateAPIDefinition(SwaggerData swaggerData) throws APIManagementException { Swagger swagger = new Swagger(); //Create info object Info info = new Info(); info.setTitle(swaggerData.getTitle()); if (swaggerData.getDescription() != null) { info.setDescription(swaggerData.getDescription()); } Contact contact = new Contact(); //Create contact object and map business owner info if (swaggerData.getContactName() != null) { contact.setName(swaggerData.getContactName()); } if (swaggerData.getContactEmail() != null) { contact.setEmail(swaggerData.getContactEmail()); } if (swaggerData.getContactName() != null || swaggerData.getContactEmail() != null) { //put contact object to info object info.setContact(contact); } info.setVersion(swaggerData.getVersion()); swagger.setInfo(info); updateSwaggerSecurityDefinition(swagger, swaggerData, "https://test.com"); updateLegacyScopesFromSwagger(swagger, swaggerData); for (SwaggerData.Resource resource : swaggerData.getResources()) { addOrUpdatePathToSwagger(swagger, resource); } return getSwaggerJsonString(swagger); }
Example 10
Source File: GenerateService.java From sofa-rpc with Apache License 2.0 | 4 votes |
public Info getInfo() { Info info = new Info(); info.setVersion(""); info.setTitle("Swagger API"); return info; }
Example 11
Source File: RestAPIResourceConfig.java From datacollector with Apache License 2.0 | 4 votes |
public RestAPIResourceConfig() { register(new AbstractBinder() { @Override protected void configure() { bindFactory(PipelineStoreInjector.class).to(PipelineStoreTask.class); bindFactory(AclStoreInjector.class).to(AclStoreTask.class); bindFactory(StageLibraryInjector.class).to(StageLibraryTask.class); bindFactory(PrincipalInjector.class).to(Principal.class); bindFactory(URIInjector.class).to(URI.class); bindFactory(ConfigurationInjector.class).to(Configuration.class); bindFactory(RuntimeInfoInjector.class).to(RuntimeInfo.class); bindFactory(BuildInfoInjector.class).to(BuildInfo.class); bindFactory(StatsCollectorInjector.class).to(StatsCollector.class); bindFactory(StandAndClusterManagerInjector.class).to(Manager.class); bindFactory(SupportBundleInjector.class).to(SupportBundleManager.class); bindFactory(EventHandlerTaskInjector.class).to(EventHandlerTask.class); bindFactory(BlobStoreTaskInjector.class).to(BlobStoreTask.class); bindFactory(CredentialStoreTaskInjector.class).to(CredentialStoresTask.class); bindFactory(UserGroupManagerInjector.class).to(UserGroupManager.class); bindFactory(UsersManagerInjector.class).to(UsersManager.class); bindFactory(ActivationInjector.class).to(Activation.class); } }); register(new PaginationInfoInjectorBinder()); register(RolesAnnotationFilter.class); register(CsrfProtectionFilter.class); register(MultiPartFeature.class); //Hooking up Swagger-Core register(ApiListingResource.class); register(SwaggerSerializers.class); register(RestResponseFilter.class); //Configure and Initialize Swagger BeanConfig beanConfig = new BeanConfig(); beanConfig.setVersion("1.0.0"); beanConfig.setBasePath("/rest"); beanConfig.setResourcePackage(RestAPI.class.getPackage().getName()); beanConfig.setScan(true); beanConfig.setTitle("Data Collector RESTful API"); Info info = new Info(); info.setTitle("Data Collector RESTful API"); info.setDescription("An Enterprise-Grade Approach to Managing Big Data in Motion"); info.setVersion("1.0.0"); beanConfig.setInfo(info); }