13

私が取り組んでいるプロジェクトでいくつかの Apiary ドキュメントを編集しており、API 呼び出しの 1 つへのパラメーターが日時文字列であることを示す必要があります。Apiary はこのパラメーターの書式設定を窒息させているように見えるので、Apiary でこのパラメーターを文書化するための提案されたアプローチはどうなるのだろうと思っています。

実証するために、Apiary から標準のデフォルト ドキュメントChoiceを取得し、次のように日時オブジェクトを取得するようにドキュメントを変更しました。

## Choice [/questions/{question_id}/choices/{choice_id}/{datetime}]

+ Parameters
    + question_id: 1 (required, number) - ID of the Question in form of an integer
    + choice_id: 1 (required, number) - ID of the Choice in form of an integer
    + datetime: 2015-05-05T12:30:00 (optional, date) - The date/time (ISO8601 format) associated with this choice

この最終結果は次のテキストです。

datetime
05-05T12:30:00 (optional, date) - The date/time (ISO8601 format) that all returned events should be greater than or equal to Example: 2015.

これは明らかに間違っています。例の値を書き留めても問題ありません。ダッシュ ( -) は、ここで問題を引き起こしている特殊文字です。これを正しく行うための推奨されるアプローチは何ですか?

4

1 に答える 1

26

エスケープ シーケンスとしてバックティックを使用できるはずです。また、 のようなタイプはありませんdateのでご注意ください。使用する必要がありますstring

+ datetime: `2015-05-05T12:30:00` (optional, string) - The date/time (ISO8601 format) associated with this choice
于 2015-07-13T13:13:57.763 に答える