io.swagger.v3.oas.models.headers.Header.getDescription()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(125)

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

Header.getDescription介绍

[英]returns the description property from a Header instance.
[中]从标头实例返回description属性。

代码示例

代码示例来源:origin: quen2404/openapi-diff

protected String itemHeader(String title, String name, Header header) {
 return this.itemHeader(title, name, header.getDescription());
}

代码示例来源:origin: quen2404/openapi-diff

protected String itemHeader(String code, ChangedHeader header) {
 return this.itemHeader(
   "Changed header",
   code,
   null == header.getNewHeader() ? "" : header.getNewHeader().getDescription());
}

代码示例来源:origin: org.openapitools/openapi-generator

/**
 * Add headers to codegen property
 *
 * @param response   API response
 * @param properties list of codegen property
 */
private void addHeaders(OpenAPI openAPI, ApiResponse response, List<CodegenProperty> properties) {
  if (response.getHeaders() != null) {
    for (Map.Entry<String, Header> headers : response.getHeaders().entrySet()) {
      String description = headers.getValue().getDescription();
      // follow the $ref
      Header header = ModelUtils.getReferencedHeader(openAPI, headers.getValue());
      CodegenProperty cp = fromProperty(headers.getKey(), header.getSchema());
      cp.setDescription(escapeText(description));
      cp.setUnescapedDescription(description);
      properties.add(cp);
    }
  }
}

代码示例来源:origin: quen2404/openapi-diff

openApiDiff
  .getMetadataDiff()
  .diff(left.getDescription(), right.getDescription(), context)
  .ifPresent(changedHeader::setDescription);
openApiDiff

代码示例来源:origin: org.tomitribe/swagger2markup

descriptionBuilder.newLine(true);
Header headerProperty = header.getValue();
String headerDescription = markupDescription(config.getSwaggerMarkupLanguage(), markupDocBuilder, headerProperty.getDescription());
  headerSchema = new StringSchema();
  headerSchema.setName(header.getKey());
  headerSchema.setDescription(headerProperty.getDescription());
  headerSchema.setRequired(Stream.of(header.getKey()).collect(Collectors.toList()));
  headerSchema.setDeprecated(headerProperty.getDeprecated());

相关文章