From 7a819b15b606dc60865d2c04a5ace1c94fa9f93a Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Dec 2015 17:39:00 +0000 Subject: [PATCH] Make it clear that JSON array responses can be documented Closes gh-163 --- .../src/docs/asciidoc/documenting-your-api.adoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/src/docs/asciidoc/documenting-your-api.adoc b/docs/src/docs/asciidoc/documenting-your-api.adoc index c7a184cb..840171c9 100644 --- a/docs/src/docs/asciidoc/documenting-your-api.adoc +++ b/docs/src/docs/asciidoc/documenting-your-api.adoc @@ -167,6 +167,23 @@ The following paths are all present: |=== +A response that uses an array at its root can also be documented. The path `[]` will refer +to the entire array. You can then use bracket or dot notation to identify fields within +the array's entries. For example, `[].id` corresponds to the `id` field of every object +found in the following array: + +[source,json,indent=0] +---- + [ + { + "id":1 + }, + { + "id":2 + } + ] +---- + [[documenting-your-api-request-response-payloads-json-field-types]]