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

Allow users to provide JSON schemas manually. #453

Closed
OrangeTux opened this issue Jul 20, 2023 · 0 comments · May be fixed by #459
Closed

Allow users to provide JSON schemas manually. #453

OrangeTux opened this issue Jul 20, 2023 · 0 comments · May be fixed by #459
Labels
ocpp2.1 Issues related to OCPP 2.1 support

Comments

@OrangeTux
Copy link
Contributor

The Open Charge Alliance (OCA) is working on OCPP 2.1. Unfortunately, the OCA distributes the JSON schemas only to members of the OCA. Therefore, I can't include the JSON schemas in this project.

Users of this library should be able to provide schemas manually.

@OrangeTux OrangeTux added the ocpp2.1 Issues related to OCPP 2.1 support label Jul 20, 2023
OrangeTux added a commit that referenced this issue Jul 21, 2023
The OCA doesn't allow to share the JSON schemas for OCPP 2.1 outside
it's members. Thus this library can't include these schemas.

This commit introduces the `SchemaValidator`: a structure that loads
schemas located at inprovide folder and validates payload against those schemas.
The file names of the schema must follow the format '<action>Request' or
'<action>Response'. E.g.: "HeartbeatRequest" or
"BootNotificationResponse".

The file names for the schemas of OCPP 1.6 and OCPP 2.0 have been
adjusted to follow this pattern.

Users relying on `ocpp.v16`, `ocpp.v20` or `ocpp.v201` shouldn't be affected
by introduction of `SchemaValidator`. These modules create a default instance of `Validator`
to include the right set of schemas.

Users of `ocpp.v21` can create a custom validator and pass it to the
construct of `ocpp.v21.ChargePoint`. See also the two examples in
`examples/v21/`.

Fixes: #453
OrangeTux added a commit that referenced this issue Jul 21, 2023
The OCA doesn't allow to share the JSON schemas for OCPP 2.1 outside
it's members. Thus this library can't include these schemas.

This commit introduces the `SchemaValidator`: a structure that loads
schemas located at inprovide folder and validates payload against those schemas.
The file names of the schema must follow the format '<action>Request' or
'<action>Response'. E.g.: "HeartbeatRequest" or
"BootNotificationResponse".

The file names for the schemas of OCPP 1.6 and OCPP 2.0 have been
adjusted to follow this pattern.

Users relying on `ocpp.v16`, `ocpp.v20` or `ocpp.v201` shouldn't be affected
by introduction of `SchemaValidator`. These modules create a default instance of `Validator`
to include the right set of schemas.

Users of `ocpp.v21` can create a custom validator and pass it to the
construct of `ocpp.v21.ChargePoint`. See also the two examples in
`examples/v21/`.

Fixes: #453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ocpp2.1 Issues related to OCPP 2.1 support
Development

Successfully merging a pull request may close this issue.

2 participants