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

API: Change show.seasons structure #5121

Closed
sharkykh opened this issue Sep 6, 2018 · 4 comments
Closed

API: Change show.seasons structure #5121

sharkykh opened this issue Sep 6, 2018 · 4 comments
Milestone

Comments

@sharkykh
Copy link
Contributor

sharkykh commented Sep 6, 2018

Related to this discussion.

Option 1:

An object where the keys are the season numbers (as strings because JSON doesn't support key indices)

"show": {
    "seasons": {
        "0": [
            { episode1 (object) },
            // ...
            { episodeN (object) }
        ],
        "1": {
            { episodeN (object) }
        },
        // ...
    }
}

Option 2:

An array of objects

"show": {
    "seasons": [
        {
            "season": 0,
            "episodes": [
                { episode1 (object) },
                // ...
                { episodeN (object) }
            ]
        },
        { season1 (object) },
        // ...
    ]
}
@p0psicles
Copy link
Contributor

I would go with option 1. As its a little unlogic to get a specific season having to loop over them.

@p0psicles
Copy link
Contributor

I had to search a little. But it seems we share an opinion.

@sharkykh
Copy link
Contributor Author

sharkykh commented Sep 6, 2018

@p0psicles Yeah the first option was actually my second suggestion, so I do like it better than the other option.

@sharkykh
Copy link
Contributor Author

sharkykh commented Sep 6, 2018

Ughh...
patternProperties isn't supported by OpenAPI (both 2.0 and 3.0).
If it isn't supported, we can't really use in the API definition, which is a problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants