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

repositories required in datacenters #5

Open
crotwell opened this issue Sep 3, 2019 · 0 comments
Open

repositories required in datacenters #5

crotwell opened this issue Sep 3, 2019 · 0 comments

Comments

@crotwell
Copy link

crotwell commented Sep 3, 2019

In the json schema, repositories is not required in datacenters. But because repositories is an array, there are two ways for a json to say a datacenter doesn't have any repositories, either a missing repositories subelement, or have repositories be a subelement but be of length zero.

It is much easier to write client software if there is only one way. Since the array must be allowed to be of zero length, making repositories required would be helpful.

It may seem a small thing, but to have to check for both the existence of repositories and for repositories to exist but be length zero is cumbersome and often overlooked as a source of bugs. This would also makes it work the same way as a top level query that doesn't return any datacenters, which results in
{"version": 1.0, "datacenters": []}

Similar for services within repositories, the array should be required, but can be of zero length.

Datasets withing repositories is a trickier matter as there is a query parameter to not include them, so could probably remain optional, although a zero length array could also be used.

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

No branches or pull requests

1 participant