io.swagger.models.Tag.description()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中io.swagger.models.Tag.description()方法的一些代码示例,展示了Tag.description()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tag.description()方法的具体详情如下:
包路径:io.swagger.models.Tag
类名称:Tag
方法名:description

Tag.description介绍

暂无

代码示例

代码示例来源:origin: Swagger2Markup/swagger2markup

@Test
  public void testTagsComponent() throws URISyntaxException {
    List<Tag> tags = new ArrayList<>();
    tags.add(new Tag().name("Tag1").description("description"));
    tags.add(new Tag().name("Tag2"));

    Swagger2MarkupConverter.Context context = createContext();
    MarkupDocBuilder markupDocBuilder = context.createMarkupDocBuilder();

    markupDocBuilder = new TagsComponent(context).apply(markupDocBuilder, TagsComponent.parameters(tags, OverviewDocument.SECTION_TITLE_LEVEL));
    markupDocBuilder.writeToFileWithoutExtension(outputDirectory, StandardCharsets.UTF_8);

    Path expectedFile = getExpectedFile(COMPONENT_NAME);
    DiffUtils.assertThatFileIsEqual(expectedFile, outputDirectory, getReportName(COMPONENT_NAME));

  }
}

代码示例来源:origin: rakam-io/rakam

@Override
  protected void setup(Binder binder) {
    Multibinder<Tag> tags = Multibinder.newSetBinder(binder, Tag.class);
    tags.addBinding().toInstance(new Tag().name("collect").description("Collect data").externalDocs(MetadataConfig.centralDocs));
    Multibinder<HttpService> httpServices = Multibinder.newSetBinder(binder, HttpService.class);
    httpServices.addBinding().to(EventCollectionHttpService.class);
    Multibinder.newSetBinder(binder, EventMapper.class);
    httpServices.addBinding().to(AdminHttpService.class);
    httpServices.addBinding().to(ProjectHttpService.class);
  }
}

代码示例来源:origin: rakam-io/rakam

@Override
protected void setup(Binder binder) {
  Multibinder<HttpService> httpServices = Multibinder.newSetBinder(binder, HttpService.class);
  httpServices.addBinding().to(EventExplorerHttpService.class);
  Multibinder<EventMapper> timeMapper = Multibinder.newSetBinder(binder, EventMapper.class);
  timeMapper.permitDuplicates().addBinding().to(TimestampEventMapper.class).in(Scopes.SINGLETON);
  Multibinder<Tag> tags = Multibinder.newSetBinder(binder, Tag.class);
  tags.addBinding().toInstance(new Tag().name("event-explorer").description("Event Explorer").externalDocs(MetadataConfig.centralDocs));
  binder.bind(EventExplorerListener.class).asEagerSingleton();
}

代码示例来源:origin: rakam-io/rakam

@Override
  protected void setup(Binder binder) {
    Multibinder<HttpService> httpServices = Multibinder.newSetBinder(binder, HttpService.class);
    httpServices.addBinding().to(RetentionAnalyzerHttpService.class);

    Multibinder<Tag> tags = Multibinder.newSetBinder(binder, Tag.class);
    tags.addBinding().toInstance(new Tag().name("retention")
        .description("Retention Analyzer module").externalDocs(MetadataConfig.centralDocs));

//        binder.bind(RetentionAnalyzerListener.class).asEagerSingleton();
  }

代码示例来源:origin: rakam-io/rakam

@Override
protected void setup(Binder binder) {
  Multibinder<HttpService> httpServices = Multibinder.newSetBinder(binder, HttpService.class);
  httpServices.addBinding().to(ABTestingHttpService.class);
  Multibinder<Tag> tags = Multibinder.newSetBinder(binder, Tag.class);
  tags.addBinding().toInstance(new Tag().name("ab-testing").description("A/B Testing Module").externalDocs(MetadataConfig.centralDocs));
}

代码示例来源:origin: rakam-io/rakam

@Override
protected void setup(Binder binder) {
  Multibinder<HttpService> httpServices = Multibinder.newSetBinder(binder, HttpService.class);
  httpServices.addBinding().to(FunnelAnalyzerHttpService.class);
  Multibinder<Tag> tags = Multibinder.newSetBinder(binder, Tag.class);
  tags.addBinding().toInstance(new Tag().name("funnel").description("Funnel Analyzer").externalDocs(MetadataConfig.centralDocs));
}

代码示例来源:origin: rakam-io/rakam

@Override
protected void setup(Binder binder) {
  Multibinder<HttpService> httpServices = Multibinder.newSetBinder(binder, HttpService.class);
  httpServices.addBinding().to(EventStreamHttpService.class);
  Multibinder<Tag> tags = Multibinder.newSetBinder(binder, Tag.class);
  tags.addBinding().toInstance(new Tag().name("event-stream").description("Event Stream Module").externalDocs(MetadataConfig.centralDocs));
}

代码示例来源:origin: rakam-io/rakam

@Override
protected void setup(Binder binder) {
  bindConfig(binder).to(RealTimeConfig.class);
  Multibinder<HttpService> multiBinder = Multibinder.newSetBinder(binder, HttpService.class);
  multiBinder.addBinding().to(RealTimeHttpService.class);
  Multibinder<EventMapper> mappers = Multibinder.newSetBinder(binder, EventMapper.class);
  mappers.permitDuplicates().addBinding().to(TimestampEventMapper.class);
  mappers.addBinding().to(RealtimeEventProcessor.class).in(Scopes.SINGLETON);
  Multibinder.newSetBinder(binder, Tag.class).addBinding()
      .toInstance(new Tag().name("realtime").description("Realtime")
          .externalDocs(MetadataConfig.centralDocs));
}

代码示例来源:origin: kongchen/swagger-maven-plugin

private Map<String, Tag> scanClasspathForTags() {
  Map<String, Tag> tags = new HashMap<>();
  for (Class<?> aClass: new Reflections("").getTypesAnnotatedWith(SwaggerDefinition.class)) {
    SwaggerDefinition swaggerDefinition = AnnotationUtils.findAnnotation(aClass, SwaggerDefinition.class);
    for (io.swagger.annotations.Tag tag : swaggerDefinition.tags()) {
      String tagName = tag.name();
      if (!tagName.isEmpty()) {
       tags.put(tag.name(), new Tag().name(tag.name()).description(tag.description()));
      }
    }
  }
  return tags;
}

代码示例来源:origin: rakam-io/rakam

.toInstance(new Tag().name("user").description("User")
        .externalDocs(MetadataConfig.centralDocs));
tagMultibinder.addBinding()
    .toInstance(new Tag().name("user-action").description("User Action")
        .externalDocs(MetadataConfig.centralDocs));

代码示例来源:origin: kongchen/swagger-maven-plugin

protected Set<Tag> extractTags(Api api) {
  Set<Tag> output = new LinkedHashSet<>();
  if(api == null) {
    return output;
  }
  boolean hasExplicitTags = false;
  for (String tag : api.tags()) {
    if (!tag.isEmpty()) {
      hasExplicitTags = true;
      output.add(new Tag().name(tag));
    }
  }
  if (!hasExplicitTags) {
    // derive tag from api path + description
    String tagString = api.value().replace("/", "");
    if (!tagString.isEmpty()) {
      Tag tag = new Tag().name(tagString);
      if (!api.description().isEmpty()) {
        tag.description(api.description());
      }
      output.add(tag);
    }
  }
  return output;
}

代码示例来源:origin: rakam-io/rakam

.toInstance(new Tag().name("recipe").description("Recipe")
    .externalDocs(MetadataConfig.centralDocs));

代码示例来源:origin: rakam-io/rakam

tags.addBinding().toInstance(new Tag().name("admin").description("System related actions").externalDocs(MetadataConfig.centralDocs));
tags.addBinding().toInstance(new Tag().name("query").description("Analyze data").externalDocs(MetadataConfig.centralDocs));
tags.addBinding().toInstance(new Tag().name("materialized-view").description("Materialized view").externalDocs(MetadataConfig.centralDocs));

代码示例来源:origin: com.outbrain.swinfra/ob1k-swagger

private Tag buildTag(final Class<?> serviceClass) {
 final Api annotation = serviceClass.getAnnotation(Api.class);
 final String name = (annotation != null) ? annotation.value() : serviceClass.getSimpleName();
 final String description = (annotation != null) ? annotation.description() : serviceClass.getCanonicalName();
 return new Tag().name(name).description(description);
}

代码示例来源:origin: outbrain/ob1k

private Tag buildTag(final Class<?> serviceClass) {
 final Api annotation = serviceClass.getAnnotation(Api.class);
 final String name = (annotation != null) ? annotation.value() : serviceClass.getSimpleName();
 final String description = (annotation != null) ? annotation.description() : serviceClass.getCanonicalName();
 return new Tag().name(name).description(description);
}

代码示例来源:origin: com.haulmont.cuba/cuba-rest-api

.map(mc -> new Tag()
        .name(mc.getName())
        .description("Entity CRUD operations"))
    .collect(Collectors.toList());
tags.addAll(entityTags);
    .map(queryEntity -> new Tag()
        .name(queryEntity + " Queries")
        .description("Predefined queries execution"))
    .collect(Collectors.toList());
tags.addAll(queryTags);
    .map(serviceInfo -> new Tag()
        .name(serviceInfo.getName())
        .description("Middleware services execution"))
    .collect(Collectors.toList());
tags.addAll(serviceTags);

代码示例来源:origin: Valandur/Web-API

for (String tag : tags) {
  webapiTags.add(tag);
  swagger.addTag(new io.swagger.models.Tag().name(tag).description(descr));
  swagger.addTag(new io.swagger.models.Tag().name(tag).description(descr));

代码示例来源:origin: io.swagger/swagger-parser

public Tag tag(ObjectNode node, String location, ParseResult result) {
  Tag tag = null;
  if(node != null) {
    tag = new Tag();
    Set<String> keys = getKeys(node);
    String value = getString("name", node, true, location, result);
    tag.name(value);
    value = getString("description", node, false, location, result);
    tag.description(value);
    ObjectNode externalDocs = getObject("externalDocs", node, false, location, result);
    ExternalDocs docs = externalDocs(externalDocs, location + "externalDocs", result);
    tag.externalDocs(docs);
    // extra keys
    for(String key : keys) {
      if(key.startsWith("x-")) {
        tag.setVendorExtension(key, extension(node.get(key)));
      }
      else if(!TAG_KEYS.contains(key)) {
        result.extra(location + ".externalDocs", key, node.get(key));
      }
    }
  }
  return tag;
}

代码示例来源:origin: com.github.xiaoymin/swagger-bootstrap-ui

tag.name(tagName).description(sourceTag.getDescription());
Api tagApi=null;
RestHandlerMapping tagMapping=null;

相关文章