SwaggerGenerator.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:endpoints-java 作者:
private Swagger writeSwagger(Iterable<ApiConfig> configs, SwaggerContext context,
    GenerationContext genCtx)
    throws ApiConfigException {
  ImmutableListMultimap<ApiKey, ? extends ApiConfig> configsByKey = FluentIterable.from(configs)
      .index(CONFIG_TO_ROOTLESS_KEY);
  Swagger swagger = new Swagger()
      .produces("application/json")
      .consumes("application/json")
      .scheme(context.scheme)
      .host(context.hostname)
      .basePath(context.basePath)
      .info(new Info()
          .title(context.hostname)
          .version(context.docVersion));
  for (ApiKey apiKey : configsByKey.keySet()) {
    writeApi(apiKey, configsByKey.get(apiKey), swagger, genCtx);
  }
  writeQuotaDefinitions(swagger, genCtx);
  return swagger;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号