2016-06-08 62 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