w3c / w3c-api

The W3C API
https://w3c.github.io/w3c-api/
214 stars 92 forks source link

Need schema and better defaults #15

Open darobin opened 9 years ago

darobin commented 9 years ago

I just got bitten because some data instances don't follow the same pattern as others, and cannot be predicted. Many user affiliations look like this but there are some that look like that.

This cannot be guessed because there is no schema documenting the expectation, and it can easily cause an application to malfunction (it just did).

More generally, the pattern of exposing a field as a array if there are several items but as a scalar when there is only one is a poor one. You're much better off with always having an array, possibly of one item.

tagawa commented 9 years ago

:+1: for keeping it simple.