Openapi-specification: Example for nested arrays

Created on 13 Feb 2015  路  6Comments  路  Source: OAI/OpenAPI-Specification

If I'm reading the spec correctly, 2.0 includes support for containers of containers or nested arrays.

Could an example of this scenario be added to the pet store samples?

Most helpful comment

YAML

    type: array
    minItems: 2
    maxItems: 2
    items:
      type: array
      items:
        type: string

All 6 comments

Not sure if it's related, but I asked a similar question in google-group before.

@stevegreatrex yes, that's correct. The tooling has not caught up yet to support those but that work is in-progress.

I'm trying to update the swashbuckle library to reflect this - could you give me an idea of how you would expect that situation to come out in the final JSON?

A nested array could look like the following:

{
  "type": "array",
  "items": {
    "type": "array",
    "items": {
       "type": "integer",
       "format": "int64"
    }
  }
}

to represent [[1,2,3]]

Perfect, thanks!

YAML

    type: array
    minItems: 2
    maxItems: 2
    items:
      type: array
      items:
        type: string
Was this page helpful?
0 / 5 - 0 ratings