2016-06-08 84 views
1

我正在使用节点招摇。它工作正常。我想发布json主体而不用定义详细的模式。例如,下面我不想指定对象属性。有没有办法做到这一点?招摇身体没有模式

/pets: 
post: 
description: Add new 
parameters: 
    - name: id 
    in: body 
    description: data to post 
    required: true 
    type: object 
responses: 
    '200': 
    description: A list of pets 
    schema: 
     type : string 

这不是渲染textarea发布json数据。

回答

1

试试这个YAML:

--- 
swagger: '2.0' 
info: 
    version: 0.0.0 
    title: Simple API 
paths: 
    /: 
    post: 
     produces: 
     - application/json 
     parameters: 
     - in: body 
      name: id 
      required: true 
      schema: 
      "$ref": "#/definitions/inBody" 
     responses: 
     201: 
      description: Added 
definitions: 
    inBody: 
    type: object 
+0

还有淋巴结招摇模块的问题。没有定义模式对象属性,它不显示textarea。所以我用swgger-ui使用了节点swagger。现在它工作正常。谢谢Sampada – Rohit

+0

很高兴有帮助! – Sampada