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

OcpiLocation object - 2.1.1 properties (validation missing) #11

Conversation

LiorBenAri
Copy link
Contributor

@LiorBenAri LiorBenAri commented Sep 19, 2023

Hi @YuriyDurov,
I've added the 2.1.1 properties to the OcpiLocation object.
I guess you would like to add validation to the new properties:

  1. Validation that properties with different names on the 2 versions aren't both populated - for example, only one of max_amperage, amperage is populated.

  2. Validation of the string property's sizes according to version - for example the size of "id" property in 2.1.1 is string(39) and on 2.2.1 is string(36).

  3. Validation of enum values - some of the 2.1.1 enum types include less entries then on their 2.2.1 version.

I'm not familiar with the library validation infrastructure, so it was hard for me to conclude on how to do these validations - can you assist with that?

Thanks,
Lior

@YuriyDurov
Copy link
Member

@LiorBenAri Hello! Awesome, I am merging this in. I will fix minor issues (e.g. you have a mistake in your inline documentation to one of the enum's values), and do some adjustments. I will also change how we handle the validation (it seems we will have to add the current OCPI version as an additional parameter when validating OCPI objects) and notify you once it's completed. Great job, thanks for the help!

@YuriyDurov YuriyDurov merged commit d6e3920 into BitzArt:main Sep 19, 2023
@LiorBenAri
Copy link
Contributor Author

LiorBenAri commented Sep 19, 2023

@LiorBenAri Hello! Awesome, I am merging this in. I will fix minor issues (e.g. you have a mistake in your inline documentation to one of the enum's values), and do some adjustments. I will also change how we handle the validation (it seems we will have to add the current OCPI version as an additional parameter when validating OCPI objects) and notify you once it's completed. Great job, thanks for the help!

Hi @YuriyDurov,

Sounds good.
Will keep tracking the library changes.
Thank you, your library is a great help for us.

@YuriyDurov
Copy link
Member

YuriyDurov commented Sep 19, 2023

Hello again @LiorBenAri!
Please check the new release
I have tried checking all the Location module change notes from 2.1.1 to 2.2 and tried to make sure the current validators operate appropriately for every OCPI version, but I might have missed some things so please let me know if you find any discrepancies with your 2.1.1 implementation. I will try to achieve backwards compatibility for other modules (Sessions, CDRs) later.

Also provided some improved examples on implementing Locations module in the sample app, so make sure to check that out as well.

@LiorBenAri
Copy link
Contributor Author

LiorBenAri commented Sep 19, 2023

Hello again @LiorBenAri! Please check the new release I have tried checking all the Location module change notes from 2.1.1 to 2.2 and tried to make sure the current validators operate appropriately for every OCPI version, but I might have missed some things so please let me know if you find any discrepancies with your 2.1.1 implementation. I will try to achieve backwards compatibility for other modules (Sessions, CDRs) later.

Hi @YuriyDurov ,

Thank you for your quick solution.
We will work with the new version and will update you with a feedback.

Thanks,
Lior

@LiorBenAri LiorBenAri deleted the OCPI.Net-LiorBenAri-adding-2.1.1-properties-to-location-object branch December 21, 2023 09:06
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