2016-11-24 6 views
0

Swaggerのモデルアイテムに追加情報を追加しようとしています。ドキュメントには、GFM構文を説明フィールドで使用できると記載されていますが、これはすべての場所で機能していません。ここでスウェーガーモデルの説明でマークダウンを使用するにはどうすればよいですか?

は、問題の最小限のダミー例です。

swagger: '2.0' 
info: 
    title: Example API 
    description: (1) This is the API description containing some *rich* **text** 
    version: "1.0.0" 
paths: 
    /products: 
    get: 
     summary: Product Types 
     description: (2) This is the path description also containing some *rich* **text** 

     responses: 
     200: 
      description: (3) This is a response description also containing some *rich* **text** 
      schema: 
      type: array 
      items: 
       $ref: '#/definitions/Product' 

definitions: 
    Product: 
    description: (4) This is a model description where *rich* **text** does not work 
    type: object 
    properties: 
     product_id: 
     type: string 
     description: (5) This is a field description where *rich* **text** does not work 

Output from Swagger editor

schema object documentationは、私は(4)とマークされた場所でのMarkdownを使用することができるはずと言う超えるがありません場所について何か言いなさい(5)。

モデルセクションの2か所のいずれかにMarkdownを追加します。これをどのように機能させることができますか?

+1

https://github.com/swagger-api/swagger-editor/issues/682:「JSONスキーマオブジェクトをレンダリングするには、[json-schema-view-js](https://github.com)を使用してください。/mohsen1/json-schema-view-js)Markdownをサポートしていないlib。Swagger Editorはこのlibの動作を変更することはできません。 – Helen

+0

@Helenありがとう。それは私の正確な問題ですが、私よりもはるかに簡潔に尋ねました:)彼らは正しいか、あまり誤解を招かないようにドキュメントを実際に更新するべきです。 –

+0

これはSwagger仕様のこの部分を完全に実装していない点でエディタには問題があります。スペックは仕様であり、それを実装するのはツール開発者次第です。 – Helen

答えて

1

スワッガーエディタは、モデルの説明でMarkdownをサポートしていません。 https://github.com/swagger-api/swagger-editor/issues/682から:

JSONスキーマオブジェクトのレンダリングでは、Markdownをサポートしていないjson-schema-view-js libを使用しています。 Swagger Editorはこのlibの動作を変更することはできません。この動作はlibに追加するのに共通するものではありません。

この機能が必要な場合は、swagger-editorおよび/またはjson-schema-view-jsをフォークし、自分自身を修正/機能を実装し、プルリクエストを提出することができます。

関連する問題