Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to properly document arrays #32

Open
BigDataKatha opened this issue Jan 14, 2019 · 1 comment
Open

How to properly document arrays #32

BigDataKatha opened this issue Jan 14, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@BigDataKatha
Copy link
Contributor

BigDataKatha commented Jan 14, 2019

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?

@BigDataKatha BigDataKatha added the help wanted Extra attention is needed label Jan 14, 2019
@neilgoldman
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants