-
-
Notifications
You must be signed in to change notification settings - Fork 806
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
Added fields serializer for LinkPreviewOptions #1483
Conversation
✔️ Changelog found.Thank you for adding a description of the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix is completely incorrect.
The specified fields are of type bool
, but for some unknown reason you are converting it to strings like Default('prefer_small_media')
therefore, the serialization result cannot be properly deserialized.
I described the workaround in the issue #1450 (comment).
But I need to research it more to find a better solution.
Ive wrote my thoughts about this problem in the issue topic, now the Message object can be serialized and deserialized properly |
I'm sorry, but you keep making things worse and worse, so stop it. As I wrote earlier, please wait, I need to analyze the situation and find a system solution, because the problem described is actually not only related to this object. |
Description
Added custom fields json serializer for LinkPreviewOptions, so model_dump_json() works with messages with links
Fixes #1450
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
[x] Send message to bot with link preview
Try to call model_dump_json method on it
Message serializes
Test Configuration:
Checklist: