Skip to content
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

Consider using pydantic for our internal models #40

Open
eclipse-csi-bot opened this issue May 23, 2023 · 1 comment
Open

Consider using pydantic for our internal models #40

eclipse-csi-bot opened this issue May 23, 2023 · 1 comment

Comments

@eclipse-csi-bot
Copy link
Contributor

In GitLab by @netomi on May 23, 2023, 09:01

When using pydantic we could get rid of our jsonschema files as validation would be performed by pydantic itself.
This seemed like a good idea (and still is), but as we migrated now to dataclasses for our internal model, maintaining supported properties in two places (model class, schema) could be avoided by using pydantic (which also supported dataclasses, so the model would not have to be changed).

Currently, we use metadata for dataclass fields, which is very handy, we need to find ways how something similar can be supported with pydantic before we make the switch.

@eclipse-csi-bot
Copy link
Contributor Author

In GitLab by @netomi on May 31, 2023, 09:07

pydantic also supports dataclasses, with that we could keep the existing logic by using the powers of pydantic wrt schema validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants