Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Weaken restrictions on Surveyor timestamps.
NCS Core uses the json-schema Ruby library[0], which incorrectly interprets schemas like this: sub.json -------- { "attr": { "extends": { "$ref": "http://www.example.edu/super.json" }, "type": [ "string", "null" ] }} super.json ---------- { "type": "string" } Section 5.26 (on "extends") of JSON Schema Draft 03 states A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. However, when validating a document like { "attr": null } against sub.json, the json-schema library will incorrectly flag it as an error: The property '#/' of type NilClass did not match the following type: string I generally find altering specifications to satisfy implementations to be distastefully backwards, but in this case I'll make an exception: 1. We need NCS Core's sync system up as fast as possible. This is the most expedient path. 2. I have no evidence to prove this -- so this is very much a ready-fire-aim deal -- but I doubt anyone else is doing anything serious with Surveyor's JSON representations and a JSON Schema validator. The right way to fix this would be to use an up-to-date draft of JSON Schema (or adapt some other means of communicating JSON formats), but draft 04 is still unpublished, and JSON Schema is the leading effort in this field. I guess we could also switch to a different validation engine for NCS Core, but that takes more effort than just making timestamps nullable all around. So there you go. [0] https://github.com/hoxworth/json-schema
- Loading branch information