提问者:小点点

Swagger创建API文档:Swagger Editor


我使用swagger来记录我的RESTAPI服务。我有一个特定的输入,我提供给服务。我正在使用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个答案

匿名用户

这是Swagger Editor 3.3.0和SwaggerUI3.11.0中的bug。它在编辑器3.3.1和UI3.12.0(2018年3月4日发布)中得到修复。

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