Skip to content

Commit

Permalink
Require CloudEvents Source be a URI (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdebrie authored and mthenw committed Apr 26, 2018
1 parent e3b1318 commit 529cc4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Event struct {
EventType Type `json:"eventType" validate:"required"`
EventTypeVersion string `json:"eventTypeVersion,omitempty"`
CloudEventsVersion string `json:"cloudEventsVersion" validate:"required"`
Source string `json:"source" validate:"url,required"`
Source string `json:"source" validate:"uri,required"`
EventID string `json:"eventID" validate:"required"`
EventTime time.Time `json:"eventTime,omitempty"`
SchemaURL string `json:"schemaURL,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions event/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ var newTests = []struct {
[]byte(`{
"eventType": "user.created",
"cloudEventsVersion": "`+ eventpkg.TransformationVersion +`",
"source": "https://example.com/",
"source": "/mysource",
"eventID": "6f6ada3b-0aa2-4b3c-989a-91ffc6405f11",
"contentType": "text/plain",
"data": "test"
}`),
eventpkg.Event{
EventType: eventpkg.Type("user.created"),
CloudEventsVersion: eventpkg.TransformationVersion,
Source: "https://example.com/",
Source: "/mysource",
ContentType: "text/plain",
Data: "test",
},
Expand Down

0 comments on commit 529cc4a

Please sign in to comment.