-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds model_to_object() function (#34)
This library currently contains a lot of functionality for going from a dictionary to a model, but doesn't have an interface for going the other way. All of the models are currently Pydantic models and Pydantic makes a `dict()` method available on all models, but that method isn't sufficient for OpenJD models. OpenJD models may contain values of type Decimal, and Decimal types don't serialize in to json/yaml using the default encoders. This adds a method that can be used to convert a model to a dictionary in a way that is compatible with json/yaml encoders -- we convert all Decimal values in to strings. Signed-off-by: Daniel Neilson <53624638+ddneilson@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
113 additions
and
3 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
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