Then validation against the schema produces the following error:
[ { keyword: 'format',
dataPath: '.source',
schemaPath: '#/definitions/source/format',
params: { format: 'uri' },
message: 'should match format "uri"' } ]
This is because of source value is /mycontext, that is an invalid URI.
A valid URI must have this format: URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]. Checkout here: https://www.ietf.org/rfc/rfc3986.txt
According to RFC 3986, Section 3, the scheme and hier-part are required.
Then, to work properly against the schema validation, I suggest an edit in the serialized JSON example, in source value example, changing it to from:/mycontext adding the scheme from:, as follows:
{
"cloudEventsVersion":"0.1",
"eventType":"com.example.someevent",
"source":"from:/mycontext",
"eventID":"A234-1234-1234",
"eventTime":"2018-04-05T17:31:00Z",
"comExampleExtension1":"value",
"comExampleExtension2":{
"otherValue":5
},
"contentType":"text/xml",
"data":"<much wow=\"xml\"/>"
}
Or an adjustment in JSON Schema in source definition, changing it to another type instead of URI.
Then validation against the schema produces the following error:
This is because of
sourcevalue is/mycontext, that is an invalid URI.A valid URI must have this format:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]. Checkout here: https://www.ietf.org/rfc/rfc3986.txtAccording to RFC 3986, Section 3, the
schemeandhier-partare required.Then, to work properly against the schema validation, I suggest an edit in the serialized JSON example, in
sourcevalue example, changing it tofrom:/mycontextadding the schemefrom:, as follows:{ "cloudEventsVersion":"0.1", "eventType":"com.example.someevent", "source":"from:/mycontext", "eventID":"A234-1234-1234", "eventTime":"2018-04-05T17:31:00Z", "comExampleExtension1":"value", "comExampleExtension2":{ "otherValue":5 }, "contentType":"text/xml", "data":"<much wow=\"xml\"/>" }Or an adjustment in JSON Schema in
sourcedefinition, changing it to another type instead ofURI.