News for hackers. Stuff that matters.
Re:Transit – A format for conveying values between different... by VMG on Wednesday July 23, 2014 @03:21AM (#8073247)
> 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`.

Re:Transit – A format for conveying values between different... by alexatkeplar on Wednesday July 23, 2014 @07:02AM (#8073681)
Here 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.
Re:Transit – A format for conveying values between different... by VMG on Wednesday July 23, 2014 @12:22PM (#8075181)
I'll admit that this doesn't look too bad, but it's an additional effort. You wouldn't do this for very simple formats.