diff --git a/lib/bindings/http/receiver_structured_0_3.js b/lib/bindings/http/receiver_structured_0_3.js index f5c04f1..45f0982 100644 --- a/lib/bindings/http/receiver_structured_0_3.js +++ b/lib/bindings/http/receiver_structured_0_3.js @@ -51,6 +51,10 @@ setterByAttribute[Constants.STRUCTURED_ATTRS_03.CONTENT_TYPE] = { name: "dataContentType", parser: (v) => v }; +setterByAttribute[Constants.STRUCTURED_ATTRS_03.SUBJECT] = { + name: "subject", + parser: (v) => v +}; setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = { name: "data", parser: (v) => v diff --git a/test/bindings/http/unmarshaller_0_3_tests.js b/test/bindings/http/unmarshaller_0_3_tests.js index 421b194..9304451 100644 --- a/test/bindings/http/unmarshaller_0_3_tests.js +++ b/test/bindings/http/unmarshaller_0_3_tests.js @@ -9,7 +9,7 @@ const webhook = "https://cloudevents.io/webhook"; const contentType = "application/cloudevents+json; charset=utf-8"; const now = new Date(); const schemaurl = "http://cloudevents.io/schema.json"; - +const subject = "subject.ext"; const ceContentType = "application/json"; const data = { @@ -118,9 +118,10 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => { new Cloudevent(v03.Spec) .type(type) .source(source) - .contenttype(ceContentType) + .dataContentType(ceContentType) .time(now) .schemaurl(schemaurl) + .subject(subject) .data(data) .toString();