Skip to content

Commit b51876a

Browse files
committed
Fixing the subject unmarshall: Closes #32
Signed-off-by: Fabio José <[email protected]>
1 parent 8893497 commit b51876a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/bindings/http/receiver_structured_0_3.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ setterByAttribute[Constants.STRUCTURED_ATTRS_03.CONTENT_TYPE] = {
5151
name: "dataContentType",
5252
parser: (v) => v
5353
};
54+
setterByAttribute[Constants.STRUCTURED_ATTRS_03.SUBJECT] = {
55+
name: "subject",
56+
parser: (v) => v
57+
};
5458
setterByAttribute[Constants.STRUCTURED_ATTRS_03.DATA] = {
5559
name: "data",
5660
parser: (v) => v

test/bindings/http/unmarshaller_0_3_tests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const webhook = "https://cloudevents.io/webhook";
99
const contentType = "application/cloudevents+json; charset=utf-8";
1010
const now = new Date();
1111
const schemaurl = "http://cloudevents.io/schema.json";
12-
12+
const subject = "subject.ext";
1313
const ceContentType = "application/json";
1414

1515
const data = {
@@ -118,9 +118,10 @@ describe("HTTP Transport Binding Unmarshaller for CloudEvents v0.3", () => {
118118
new Cloudevent(v03.Spec)
119119
.type(type)
120120
.source(source)
121-
.contenttype(ceContentType)
121+
.dataContentType(ceContentType)
122122
.time(now)
123123
.schemaurl(schemaurl)
124+
.subject(subject)
124125
.data(data)
125126
.toString();
126127

0 commit comments

Comments
 (0)