首页 文章

Swagger创建API文档:Swagger编辑器

提问于
浏览
0

我正在使用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.

1 回答

  • 0

    This was a bug在Swagger Editor 3.3.0和Swagger UI 3.11.0中 . 它在编辑器3.3.1和UI 3.12.0(2018年3月4日发布)中得到修复 .

    作为解决方法,您可以通过在浏览器中打开 index.html 文件来本地运行它 .

相关问题