-
Notifications
You must be signed in to change notification settings - Fork 91
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
Arrays should always be arrays #20
Comments
Unfortunately, that looks like a bug upstream but it doesn't to be worked on. Quickly looking at this library's code, it seems fairly hard to fix without a deep knowledge of the lib |
Ok, I guess we'll just have to live with it for the time being then. If it could be documented visibly, it would be helpful. This is almost certain to trip people up. I am now detecting this in all cases for the w3capi library, and fixing the data that is returned. Maybe this means that I should make a client-side version of it. @tripu @tagawa Are you aware of this problem? |
We are now, @darobin; thanks! w3c/apiary#11 |
Assigning that issue to @jean-gui who found a workaround that ensures collections are always returned as JSON array even if they only have one element. |
Fixed by @jean-gui and deployed. |
This was already mentioned in #15, but it is enough of a problem that it warrants its own bug.
Some fields are clearly meant to hold arrays, and when they contain multiple items they do. But if by chance they hold only a single item they become scalars. This is a painful antipattern to use, it constantly causes failures. I am finding myself having to write code to test for arrays pretty much everywhere.
The text was updated successfully, but these errors were encountered: