-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not properly formatting the data element of the MessageEnvelope #168
Comments
Hi @Scott-transtar, Thank you for reporting the issue. Can you please share a minimal reproducible code solution for this issue? Regards, |
Sure, here is a repo that can reproduce the issue. You will need to supply the ARN of your EventBridge in the Program.cs file. https://github.com/Scott-transtar/AWS.Messaging.SerializatinIssue Just look at the output in the log group. Detail looks like: "detail": {
|
Hello @Scott-transtar, I appreciate you providing the self-contained code sample, which allows me to replicate the issue quickly. To reproduce the problem, I followed below steps:
{
"source": [{
"prefix": ""
}]
}
"detail": {
"id": "070289aa-332e-4e69-a69b-429c1e39650f",
"source": "/AmazonEC2/i-***",
"specversion": "1.0",
"type": "Payload",
"time": "2024-12-27T16:08:24.7524137+00:00",
"data": "{\"Id\":\"052dbeff-2648-4d1f-9efa-b7737c2fd851\",\"Name\":\"Test\",\"SomeValue\":42}"
} As you mentioned, the I will further investigate this issue with the team and provide an update. Regards, |
Describe the bug
According to the Cloud Event spect, https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md#3-envelope
If the datacontenttype is unspecified (and from what I have seen is not) then SHOULD proceed as if datacontenttype had been specified explicity as application/json. "The data value MUST be stored directly as a JSON value, rather than as an encoded JSON document represented as a string."
Currently, that is how data is being stored. Working on either end of the messages, this isn't a problem, however when publishing to an EventBus you cannot reference these values in Event pattern matching.
Regression Issue
Expected Behavior
A setting is provided to specify the datacontenttype and is respected according to the spec.
If no datacontenttype is specified, as stated in the spec, it should be stored as a JSON value and not an encoded JSON document as a string.
Current Behavior
data is stored as an encoded JSON document represented as a string.
Reproduction Steps
Define a POCO for an EventBridge payload, use the AWS.Messaging library to publish the event. Have an Event Rule defined that will log to a Log Watch group and view the full json of the event, specifically in the detail section.
Possible Solution
No response
Additional Information/Context
No response
AWS.Messaging (or related) package versions
AWS.Messaging-0.9.2
Targeted .NET Platform
.NET 8
Operating System and version
Windows 11, any.
The text was updated successfully, but these errors were encountered: