support dynamic data content type#471
Conversation
0372101 to
15a7e3c
Compare
Signed-off-by: Isaac Aymerich <isaac.aymerich@roche.com>
15a7e3c to
d34b27f
Compare
|
Makes sense. Likely a change we should do in the go sdk too to support |
|
Just maybe rename |
Signed-off-by: Isaac Aymerich <isaac.aymerich@roche.com>
Signed-off-by: Isaac Aymerich <isaac.aymerich@roche.com>
updated |
| public static final String CONTENT_TYPE = "application/cloudevents+json"; | ||
|
|
||
| /** | ||
| * Suppoted Content type |
There was a problem hiding this comment.
I am not sure if it's good to call it "Supported Content type".
Other content type should work too, they will just be exposed as byte[] not objects IIRC.
There was a problem hiding this comment.
Understood, any suggestion for the naming?
There was a problem hiding this comment.
How about something along the lines of "JSON Data Content Type Discriminator" - long-winded I know ;-)
|
While we're changing this test-case could we also enhance it to ensure that the 'datacontenttype' in the deserialized event matches the 'contentType' that was used to construct the original event (from your test argument list) Just an extra level of sanity checking. |
Signed-off-by: Isaac Aymerich <isaac.aymerich@roche.com>
Done! |
|
Thanks LGTM.... |
|
/cc @pierDipi |
Now checks if `datacontenttype` matches the regex: `^(application|text)\/([a-zA-Z]+\+)?json$")` This regex support `application/foobar+json` or standard ``` application/json text/json ``` Signed-off-by: Isaac Aymerich <isaac.aymerich@roche.com> Signed-off-by: alex-butcher <21243172+abutch3r@users.noreply.github.com>
Fixes #470
Now checks if dataContentType matches the next regex.
^(application|text)\/([a-zA-Z]+\+)?json$")This regex support
application/foobar+jsonor standard