Skip to content

Format with "%v" instead of "%d" #274

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

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

lwlwilliam
Copy link
Contributor

The Data field of type DataTransferRequest is defined as interface{}.

In addition, I see that the data keys in ocppj1.6's DataTransfer.json and DataTransferResponse.json are both string types. Do I need to change the Data fields of the DataTransferRequest and DataTransferConfirmation types to the string type?

@lorenzodonini
Copy link
Owner

Hey and thanks for the contribution!

The data field is defined as interface to leave the implementation completely open. Enforcing a string type would force everyone to embed a json string within a string field (which is already inside a json), which is imo crazy. The specs for OCPP v2.0.1 define this field as anyType btw, since that's how it was intended in the first place.

That being said, the field can obviously be used as a string, if needed. Check out data_transfer_test.go for an example.

@lorenzodonini lorenzodonini merged commit 5268cd9 into lorenzodonini:master Jul 2, 2024
@lwlwilliam lwlwilliam deleted the lwlwilliam-patch-1 branch August 13, 2024 03:30
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

Successfully merging this pull request may close these issues.

2 participants