Open ace-roger opened 1 year ago
Hey Ace-roger,
I implemented the OCPI modules for version 2.2.1 as part of an internship project I did.
You can use a code generator and an OpenAPI specification file for OCPI to generate a template/boilerplate of the entire API. For example, I used an OpenAPI specification file for OCPI version 2.2 and a FastAPI code generator to generate a FastAPI application with all the OCPI 2.2 endpoints. I then updated the endpoints to match with OCPI 2.2.1 and added the functionality/implementation.
I do not know if there is an OpenAPI specification file for OCPI version 2.2.1 but you can search and see.
Please find below some useful resources: fastapi-code-generator OCPI Github repo OCPI Documentation 2.2.1 ocpi-2.2-openapi-spec.txt
Note: Change the extension of the ocpi-2.2-openapi-spec.txt to .yaml as Github does not support me uploading .yaml files
Hi Anthony Teye-Adjei ,
Thanks for responding.
Following the above steps, I am receiving an error: Exception: Modular references are not supported in this version.
I assume the error is coming from the fast-api-code-generator?
Yes
Alright, to make things easier for you, here is a starting point of the OCPI 2.2 FastAPI application I used. fastapi-ocpi-initial.zip
Hi Anthony Teye-Adjei ,
Great work,
You have implemented the session module of ocpi - any plan on implementing other modules such as location, tariff, reservation, etc.
If not, any suggestions/resources regarding it.