EveryMundo / emDataStandards

EveryMundo's Data Standards
7 stars 20 forks source link

How to properly document arrays #32

Open BigDataKatha opened 5 years ago

BigDataKatha commented 5 years ago

Current documentation in JSON:

"passengerDetails": {
    "description": "Passenger Details captured from IBE",
    "type": "array",
    "properties": {
        "category": {
        "description": "Any passenger category following the format category[Age]To[Age]Count or category[Age]Plus",
        "type": "string",
        "example": "Adult"
        },
        "count": {
        "description": "Amount of passengers for a specific category",
        "type": "number",
        "example": 1
        }
    }
}

Incorrect result in dynamic documentation:

"passengerDetails": {
      "category": "Adult",
      "count": 1
    }

Expected result:

"passengerDetails": [
            {
                "category": "Adult",               
                "count": 1
            },
            {
                "category": "Child0to17",               
                "count": 1
            }
        ]

How can I properly document an array in JSON?

neilgoldman commented 5 years ago

Hey Kat,

I've sent you a message so we can work out the specifics, but my current guess is that it is being interpreted as an array of possible matches for an array of items, instead of a fixed array that needs to be matched against. Is that the goal here?