Swagger 创建 API 文档:Swagger 编辑器
Swagger create API document: Swagger Editor
我正在使用 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.
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 日发布)中修复。
作为解决方法,您可以通过在浏览器中打开 index.html
文件在本地 download Editor v3.2.9 和 运行 它。
我正在使用 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.
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 日发布)中修复。
作为解决方法,您可以通过在浏览器中打开 index.html
文件在本地 download Editor v3.2.9 和 运行 它。