-
Notifications
You must be signed in to change notification settings - Fork 56
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
to_json on a pydantic.CloudEvent does not include extension values #228
Comments
Hey @brendanmaguire, thx for opening this issue. I'll try to take a look at it closer to the weekend, but would appreciate a PR if you're up to opening one. Can you also mention the Pydantic version you're using? |
Hey @xSAVIKx . The Pydantic version is |
Replicates bug test data from the #228 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com>
* Add custom extension attribute to the test set. Replicates bug test data from the #228 Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * use modern `super` syntax Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Fix `black` language version Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Fixes #228 Pydantic v2 .__dict__ has different behavior from what Pydantic v1 had and is not giving us `extra` fields anymore. On the other hand the iterator over the event gives us extras as well Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Add missing EOF Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Add Pydantic fix to the changelog Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Add links to the changelog Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Bump version Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> * Update Black and MyPy versions Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com> --------- Signed-off-by: Yurii Serhiichuk <savik.ne@gmail.com>
@brendanmaguire the version |
Tested and it works as expected. Thanks for the fast turnaround @xSAVIKx ! 🙂 |
Expected Behavior
When running the following:
the following should be output:
Actual Behavior
This is the output:
Note the missing
extension-key
value from the Pydantic Event JSON.Steps to Reproduce the Problem
Specifications
The text was updated successfully, but these errors were encountered: