4 ms·
> 1. isn't most of your data "de facto" schemaful anyway? Like when you send an API call with JSON, isn't there a standard set of keys that the server is expect
by VMG 12y ago
> 1. isn't most of your data "de facto" schemaful anyway? Like when you send an API call with JSON, isn't there a standard set of keys that the server is expecting? Isn't it nicer to actually write down this set of keys and their expected types in a way that a machine can understand, instead of it just being documentation on a web page?
I'd argue that it's not.
Your schema is implicitly defined somewhere in the business logic, and you have to first learn the schema description language in order to translate your application code into schema description code. And when the application code changes, you won't be very excited to adjust the schema again.
Sometimes it's worth the effort and makes development easier, often it's the opposite. An error message saying `error: articleId missing in sale object` is more informative than `schema error in line 4282`.
- alexatkeplar 12y agoHere is a JSON Schema validation failure taken straight out of the Snowplow test suite (pretty printed): { "level": "error", "schema": { "loadingURI": "#", "pointer": "" }, "instance": { "pointer": "" }, "domain": "validation", "keyword": "required", "message": "object has missing required properties ([\"targetUrl\"])", "required": [ "targetUrl" ], "missing": [ "targetUrl" ] } You can't seriously prefer a NullPointerException (or choose your poison) three functions later.
- VMG 12y agoI'll admit that this doesn't look too bad, but it's an additional effort. You wouldn't do this for very simple formats.