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

Attributes with 'v2x' are serialized as 'V2x', but should be serialized as 'V2X'. #431

Closed
OrangeTux opened this issue Mar 17, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@OrangeTux
Copy link
Collaborator

ev_min_v2x_energy_request: Optional[float] = None
ev_max_v2x_energy_request: Optional[float] = None

Serializing objects with attributes that have 'v2x' in the name, are not serialized correctly. E.g. V2XChargeParametersType.ev_max_v2x_energy_request is serialized as "evMaxV2xEnergyRequest", but it should be "evMinV2XEnergyRequest". This problem happens also to other objects.

@Jared-Newell-Mobility
Copy link
Contributor

Jared-Newell-Mobility commented Nov 15, 2023

Currently this test replicates it:

`@dataclass
class Bidirectional:
ev_min_v2x_energy_request: Optional[str] = None

def test_serialise():

expected = {'evMinV2XEnergyRequest': None}

assert snake_to_camel_case(asdict(Bidirectional())) == expected`

{'evMinV2xEnergyRequest': None} != {'evMinV2XEnergyRequest': None)

@Jared-Newell-Mobility
Copy link
Contributor

PR #522 is prepared for inclusion in v1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants