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

"Pythonic" field naming #19

Open
mo-lukecarr opened this issue Dec 18, 2024 · 0 comments
Open

"Pythonic" field naming #19

mo-lukecarr opened this issue Dec 18, 2024 · 0 comments

Comments

@mo-lukecarr
Copy link

mo-lukecarr commented Dec 18, 2024

Could we use Pydantic's field aliases to use "Pythonic" field names (i.e. snake case) in the models, without losing the compatibility of validating and serialising the EDR specification?

This work might be blocked by the fact that Pydantic currently requires you to explicitly pass by_alias=True when dumping a model instance. There doesn't appear to be a way of automatically enabling by_alias, such as through a model's ConfigDict.

If we were to implement this change and introduce aliases, we'd probably need to have a way of defaulting to validating and serialising by alias (otherwise the library would rely on users to remember to always pass by_alias=True).

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

1 participant