diff --git a/lib/cloudevent.js b/lib/cloudevent.js index 973049c..d7214d2 100644 --- a/lib/cloudevent.js +++ b/lib/cloudevent.js @@ -16,6 +16,10 @@ function Cloudevent(_spec, _formatter){ * To format the payload using the formatter */ Cloudevent.prototype.format = function(){ + // Check the constraints + this.spec.check(); + + // Then, format return this.formatter.format(this.spec.payload); } diff --git a/lib/specs/spec_0_2.js b/lib/specs/spec_0_2.js index de8fed8..01b53a8 100644 --- a/lib/specs/spec_0_2.js +++ b/lib/specs/spec_0_2.js @@ -7,6 +7,13 @@ function Spec_0_2(){ }; } +/* + * Check the spec constraints. + */ +Spec_0_2.prototype.check = function(){ + +} + Spec_0_2.prototype.type = function(_type){ this.payload['type'] = _type; return this;