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

fix: DataTransfer data types #537

Merged

Conversation

mdwcrft
Copy link
Collaborator

@mdwcrft mdwcrft commented Nov 30, 2023

In 2.0.1 both DataTransferRequest and DataTransferResponse have a field called data which is defined as AnyType so I believe these should both by of type Any here

Copy link
Contributor

@Jared-Newell-Mobility Jared-Newell-Mobility left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, could you also add an entry in the ChangeLog.md?

@Jared-Newell-Mobility Jared-Newell-Mobility mentioned this pull request Dec 6, 2023
26 tasks
@OrangeTux OrangeTux merged commit 94e5ea5 into mobilityhouse:master Dec 7, 2023
6 checks passed
@malsyned
Copy link

malsyned commented Jan 5, 2024

My read on the spec for this is different. The Field Type for data in both DataTransferRequest and DataTransferResponse is indeed listed as anyType. However, in 2.1.3. Primitive Datatypes, AnyType is defined as "Text, data without specified length or format" (emphasis mine). So I think the correct Python data type for this should be str, not Any.

This is a pretty confusing part of the spec, though, I could certainly be wrong. It looks like it has a mistake in it as well, because the capitalization isn't consistent between the Field Types anyType and the Primitive Datatype name AnyType. Maybe this part of the spec needs some TLC in the next revision.

@OrangeTux
Copy link
Collaborator

@malsyned Good catch! You're right. I think we should revert this change.

alexmclarty added a commit to alexmclarty/ocpp that referenced this pull request Jan 15, 2024
…ta typehint. The typehint should be a str type, rather than Any.
@mdwcrft
Copy link
Collaborator Author

mdwcrft commented Jan 17, 2024

My read on the spec for this is different. The Field Type for data in both DataTransferRequest and DataTransferResponse is indeed listed as anyType. However, in 2.1.3. Primitive Datatypes, AnyType is defined as "Text, data without specified length or format" (emphasis mine). So I think the correct Python data type for this should be str, not Any.

Interesting, I read "Text, data" to mean "Text OR data" - agreed it's not clear though I think @OrangeTux will ask the OCA for a clarification

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

Successfully merging this pull request may close these issues.

4 participants