Decodes a Spec from an already-parsed spec-JSON object.
Decodes a Spec from spec JSON — the inverse of toJson.