【问题标题】:Swagger create API document: Swagger EditorSwagger 创建 API 文档:Swagger Editor
【发布时间】:2018-03-05 15:52:09
【问题描述】:

我正在使用 swagger 来记录我的 REST API 服务。 我有我提供给服务的特定输入。 我正在使用 swagger 编辑器自己创建 YAML 代码。我面临的问题是我无法将输入类型作为 XML,默认情况下它采用 JSON。 我的 yaml 代码中是否有任何问题。代码如下:

swagger: "2.0"
info:
title: Order Update to Dealers
 description: API description in Markdown.
 version: 1.0.0
host: #Host name cannot be specified here
basePath: /api/OrderUpdate
schemes:
  - http
paths:
/GetFullOrderAcknowlegement:
post:
  summary: Returns a list of users.
  consumes: 
    - application/xml 
  produces:
    - text/plain

  parameters:
    - in: body
      name: DealerInput
      description: Optional extended description in Markdown.

      schema:
        properties:
          DealerID:
            type: string
          PONumber:
            type: string
  responses:
    201:
      description: Created
    200:
      schema: {}
      description: OK
    401:
      schema: {}
      description: Authorization information is missing or invalid.

【问题讨论】:

    标签: swagger swagger-editor


    【解决方案1】:

    This was a bug 在 Swagger Editor 3.3.0 和 Swagger UI 3.11.0 中。它已在 Editor 3.3.1 和 UI 3.12.0(2018 年 3 月 4 日发布)中修复。

    作为一种解决方法,您可以download Editor v3.2.9 并通过在浏览器中打开index.html 文件在本地运行它。

    【讨论】:

      猜你喜欢
      • 2014-02-22
      • 1970-01-01
      • 2018-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-05
      相关资源
      最近更新 更多