2017-12-27 29 views
1

要求の本文に複数行のサンプルを記述する方法はありますか?可能であれば、Swagger-UIで実行しているとき、OpenApiドキュメントを次のように表示したいと思います。あなたはあなたの言語についてはあまり言わないopenapi v3レスポンスボディの複数行の例

Single line example

答えて

0

:下図のようにこれまでのところ、私は達成することができてきたすべてが、シングルラインの例である

Desired result

あなたのAPIまたはどのようにあなたのswagger.jsonを生成しているための選択...

しかし、はい、それはここでは、可能であるが、いくつかのライブの例は以下のとおりです。

http://swashbuckletest.azurewebsites.net/swagger/ui/index?filter=Company#/Company/Company_Post

http://swashbuckletest.azurewebsites.net/swagger/ui/index?filter=Polygon#/PolygonVolume/PolygonVolume_Post

http://swashbuckletest.azurewebsites.net/swagger/ui/index?filter=Dictionary#/Dictionary/Dictionary_DeleteEcho



その最後のものをJSONコードは次のようになります。

"delete": { 
    "tags": [ 
     "Dictionary" 
    ], 
    "operationId": "Dictionary_DeleteEcho", 
    "consumes": [ 
     "application/json", 
     "text/json", 
     "text/html" 
    ], 
    "produces": [ 
     "application/json", 
     "text/json", 
     "text/html" 
    ], 
    "parameters": [ 
     { 
     "name": "guids", 
     "in": "body", 
     "required": true, 
     "schema": { 
      "type": "array", 
      "items": { 
      "format": "uuid", 
      "type": "string", 
      "example": "00000000-0000-0000-0000-000000000000" 
      }, 
      "example": [ 
      "00000000-0000-0000-0000-000000000000", 
      "00000000-0000-0000-0000-000000000000" 
      ] 
     } 
     } 
    ], 
... 
関連する問題