apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.65k stars 2.14k forks source link

Does not return array of examples #409

Closed manoadamro closed 6 years ago

manoadamro commented 6 years ago

if i have a schema with an example like this:

      example:
          uuid: "2c4f1d24-2952-4d4e-b1d1-3637e33cc161"
          created: '2017-09-23T08:29:19.123+00:00'
          modified: '2017-09-23T08:29:19.123+00:00'

and a path response like this

      responses:
        200:
          description: "Returns some Json object"
          schema:
            $ref: '#/definitions/Object'

i get an output as expected:

    {
      "uuid": "2c4f1d24-2952-4d4e-b1d1-3637e33cc161",
      "created": "2017-09-23T08:29:19.123+00:00",
      "modified": "2017-09-23T08:29:19.123+00:00"
    }

but when the path returns an array, like this:

      responses:
        200:
          description: "Returns some Json objects"
          schema:
            type: object
            items:
                $ref: '#/definitions/Object'

I get an output like this:

    {
      "uuid": "fugiat id in occaecat ut",
      "uri": "culpa aliqua nulla",
      "created": "laboris eu consectetur veniam",
      "modified": "dolor qui sunt"
    },
    {
      "uuid": "velit sit enim do",
      "uri": "irure Ut pariatur mollit sint",
      "created": "deserunt qui enim officia",
      "modified": "adipisicing"
    }

i would have expected an array either containing the example of containing multiple instances of the example, but It returns random strings.

Why does it use the example for some things an not others? Is there any way to have apiary return a useful example in this case? (as in, a defined example rather than Latin gibberish)