1

Apiary で定義された API コントラクトがあり、リソース モデル構文を使用してペイロードの再利用を有効にしています。

ただし、Apiary によってレンダリングされたドキュメントにはモデル名のみが表示されます (たとえば、Response 200 は [Foo][] を返します)。Foo とは何かについての詳細や、Foo モデルの属性を表示するためのリンクはありません。

モデルが与えられた場合、レンダリングされたドキュメントでそのモデルの属性を確認するにはどうすればよいですか?

更新
契約の関連部分は以下のとおりです。

### Manipulating a specific Organisation [/organisations/{id}]
Operations to retrieve and update a specific Organisation.

+ Parameters

    + id (required, guid, `F339ADA5-E836-40FE-8E90-BEF06892762E`) ... The guid Organisation `id`.

+ Model (application/json)

    + Headers

            Link : <http://foobar.com/organisations/F339ADA5-E836-40FE-8E90-BEF06892762E>;rel="self"

    + Body

            {
                "id" : "F339ADA5-E836-40FE-8E90-BEF06892762E",
                "name" : "joe's gardening supplies"
            }

### Retrieve an Organisation [GET]

+ Response 200

        [Organisation][]

### Update an Organisation [PATCH]

+ Request

        [Organisation][]

+ Response 204
4

2 に答える 2

3

あなたが例を提供しない限り、それは単なる推測ですが、私の最初の推測は間違ったレベルのインデントでしょう。ブループリントの例は次のようになります。

FORMAT: 1A
HOST: http://www.google.com

# Model Example
Notes API is a *short texts saving* service similar to its physical paper presence on your table.

# Group Notes
Notes related resources of the **Notes API**

## Note [/notes/{id}]
A single Note object with all its details

+ Parameters
    + id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.

+ Model

    + Header

            X-My-Header: The Value

    + Body

            { "id": 2, "title": "Pick-up posters from post-office" }

### Retrieve a Note [GET]
+ Response 200 (application/json)

    [Note][]

### Remove a Note [DELETE]
+ Response 204

上記のコードは、モデルが参照されている場所 (およびそのような参照がサポートされている場所、つまりペイロードの定義) にモデルが正しく組み込まれているこのドキュメントになります。

GitHub で Apiary のドキュメントの未加工バージョンを読むと、適切で正確な形式を簡単に見つけることができるため、役立つ場合があります。

于 2014-06-23T07:51:39.760 に答える