-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix Color serialization in Pydantic v2 (#6821)
- Loading branch information
1 parent
532c977
commit 9870a85
Showing
3 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from models_library.projects_nodes_ui import Marker | ||
from pydantic_extra_types.color import Color | ||
|
||
|
||
def test_marker_serialization(): | ||
m = Marker(color=Color("#b7e28d")) | ||
|
||
assert m.model_dump_json() == '{"color":"#b7e28d"}' |