Version
Summary
An audit of the OCPI 2.3.0 OpenAPI against the normative
release-2.3.0-bugfixes documentation found several remaining conformance
gaps that are not covered by the existing issues.
References used for this report:
- OpenAPI: commit
7bacd82ba531fc565fc6d7a09a49d4dabd3aaef0
- Normative OCPI documentation: commit
9ed1e39c24f5b84cb1e4008939f47bea838f9b25
1. OpenEnum schemas are semantically closed
OCPI 2.3.0 introduces OpenEnum for values whose known set is not exhaustive.
Implementations are allowed to send additional string values.
Normative definition:
https://github.com/ocpi/ocpi/blob/release-2.3.0-bugfixes/types.asciidoc#openenum-type
The OpenAPI currently models these schemas as:
type: string
format: open-enum
enum:
- KNOWN_VALUE
For example:
|
Capability: |
|
type: string |
|
format: open-enum |
|
description: The capabilities of an EVSE. |
|
enum: |
|
- CHARGING_PROFILE_CAPABLE |
|
- CHARGING_PREFERENCES_CAPABLE |
|
- CHIP_CARD_SUPPORT |
|
- CONTACTLESS_CARD_SUPPORT |
|
- CREDIT_CARD_PAYABLE |
|
- DEBIT_CARD_PAYABLE |
|
- PED_TERMINAL |
|
- REMOTE_START_STOP_CAPABLE |
|
- RESERVABLE |
|
- RFID_READER |
|
- START_SESSION_CONNECTOR_REQUIRED |
|
- TOKEN_GROUP_CAPABLE |
|
- UNLOCK_CAPABLE |
format: open-enum is not a standard OpenAPI/JSON Schema format and does not
change the semantics of enum. Standard validators and generated clients will
therefore reject values that are valid according to OCPI.
Affected schemas include at least:
Capability
ConnectorCapability
ConnectorType
EnvironmentalImpactCategory
Facility
ImageCategory
ModuleID
ParkingRestriction
ParkingType
TokenType
VehicleType
VersionNumber
CommandType
Suggested fix
Represent known values as documentation while keeping validation open, for
example:
anyOf:
- type: string
enum:
- KNOWN_VALUE
- type: string
Alternatively, keep type: string unrestricted and expose known values through
a vendor extension supported by the documentation and code-generation tools.
format: open-enum and x-enumDescriptions may remain as non-normative
documentation extensions.
Commands-specific consequence
The Commands Receiver interface currently exposes only five literal paths:
/commands/CANCEL_RESERVATION
/commands/RESERVE_NOW
/commands/START_SESSION
/commands/STOP_SESSION
/commands/UNLOCK_CONNECTOR
This prevents an extension command represented by the normative open
CommandType from being described or called by a generated client.
Consider exposing /commands/{command} with an open CommandType path
parameter, while retaining the known command payload schemas.
2. format: date-time does not encode the OCPI DateTime restrictions
The normative OCPI DateTime differs from generic RFC 3339:
- timestamps SHALL be in UTC;
+00:00 is explicitly not equivalent to UTC for OCPI;
- the
Z designator may be omitted;
- fractional seconds may be used;
- the value is limited to
string(25).
Normative definition:
https://github.com/ocpi/ocpi/blob/release-2.3.0-bugfixes/types.asciidoc#datetime-type
The OpenAPI currently uses only:
type: string
format: date-time
Examples occur in the common response schemas and throughout the module
schemas.
This has two interoperability effects:
- Generic validators accept offsets such as
+00:00, which OCPI forbids.
- Some validators reject timestamps without a timezone designator, which OCPI
explicitly permits.
Suggested fix
Introduce a reusable OCPI DateTime schema with:
type: string
maxLength: 25
- a pattern matching the OCPI UTC forms with optional fractional seconds and
optional Z
Use the same schema for object properties and for the date_from and date_to
query parameters.
3. Generated role bundles omit the Payments module
config.json declares the Payments module:
|
"payments": { |
|
"label": "Payments", |
|
"description": "Payment terminals and financial advice confirmations.", |
|
"interfaces": ["sender-interface", "receiver-interface"] |
|
}, |
However, the role configuration does not include either Payments interface:
|
"roles": { |
|
"cpo": [ |
|
"credentials/interface", |
|
"versions/interface", |
|
"locations/sender-interface", |
|
"sessions/sender-interface", |
|
"cdrs/sender-interface", |
|
"tariffs/sender-interface", |
|
"tokens/receiver-interface", |
|
"commands/receiver-interface", |
|
"chargingprofiles/receiver-interface" |
|
], |
|
"msp": [ |
|
"credentials/interface", |
|
"versions/interface", |
|
"locations/receiver-interface", |
|
"sessions/receiver-interface", |
|
"cdrs/receiver-interface", |
|
"tariffs/receiver-interface", |
|
"tokens/sender-interface", |
|
"commands/sender-interface", |
|
"chargingprofiles/sender-interface" |
|
], |
|
"hub": [ |
|
"hubclientinfo/sender-interface" |
|
] |
|
} |
The build script generates role documentation exclusively from these arrays.
Consequently:
- the CPO role bundle omits
payments/receiver-interface;
- no PTP role bundle exposes
payments/sender-interface.
Payments is explicitly introduced by the OCPI 2.3.0 changelog and has a
normative module chapter.
Suggested fix
- Add
payments/receiver-interface to the CPO role.
- Add a PTP role containing
payments/sender-interface, or document why the
role bundles intentionally exclude the PTP role.
The separate mismatch between ModuleID, Bookings, Payments, and the normative
documentation is already tracked by #9.
4. Two OCPI 2.3.0 interfaces declare info.version: 2.2.1
The following files have a 2.3.0 title and documentation link but declare
version 2.2.1:
- Commands Sender:
|
openapi: 3.1.0 |
|
info: |
|
title: OCPI 2.3.0 - Commands Module - Sender Interface |
|
description: | |
|
The Sender Interface is typically implemented by market roles like the eMSP. |
|
It receives the asynchronous responses from the Charge Point via the CPO. |
|
|
|
The URL structure is open for the Sender to define. The URL is provided to the Receiver |
|
by the Sender in the POST to the Receiver interface via the response_url field. |
|
Therefore OCPI does not define fixed URL variables. |
|
|
|
The path shown here is a typical implementation pattern. |
|
version: 2.2.1 |
|
contact: |
|
name: EVRoaming Foundation |
|
url: https://evroaming.org |
|
externalDocs: |
|
description: OCPI 2.3.0 Specification |
|
url: https://github.com/ocpi/ocpi/blob/master/mod_commands.asciidoc |
- ChargingProfiles Sender:
|
openapi: 3.1.0 |
|
info: |
|
title: OCPI 2.3.0 - ChargingProfiles Module - Sender Interface |
|
description: | |
|
The Sender Interface is typically implemented by market roles like the eMSP or SCSP. |
|
It receives the asynchronous responses from the Charge Point via the CPO, |
|
and updated ActiveChargingProfiles when the CPO knows the profile has changed. |
|
|
|
For the POST method: The URL structure is open for the Sender to define. The URL is provided |
|
to the Receiver via the response_url field. The path shown here is a typical implementation pattern. |
|
|
|
For the PUT method: The endpoint structure is {chargingprofiles_endpoint_url}/{session_id}. |
|
version: 2.2.1 |
|
contact: |
|
name: EVRoaming Foundation |
|
url: https://evroaming.org |
|
externalDocs: |
|
description: OCPI 2.3.0 Specification |
|
url: https://github.com/ocpi/ocpi/blob/master/mod_charging_profiles.asciidoc |
Suggested fix
Set info.version to 2.3.0 in both files.
5. Version-specific externalDocs links point to mutable or invalid targets
Most 2.3.0 interfaces link to files under ocpi/ocpi/blob/master, rather than
the release-2.3.0-bugfixes branch.
There are also invalid targets, for example the Payments interfaces reference
mod_payment.asciidoc, while the normative filename is
mod_payments.asciidoc.
Suggested fix
Point 2.3.0 externalDocs links to the corresponding files under:
https://github.com/ocpi/ocpi/blob/release-2.3.0-bugfixes/
and correct stale filenames.
Existing related issues
The following findings are intentionally not duplicated here:
Proposed completion criteria
Version
Summary
An audit of the OCPI 2.3.0 OpenAPI against the normative
release-2.3.0-bugfixesdocumentation found several remaining conformancegaps that are not covered by the existing issues.
References used for this report:
7bacd82ba531fc565fc6d7a09a49d4dabd3aaef09ed1e39c24f5b84cb1e4008939f47bea838f9b251. OpenEnum schemas are semantically closed
OCPI 2.3.0 introduces
OpenEnumfor values whose known set is not exhaustive.Implementations are allowed to send additional string values.
Normative definition:
https://github.com/ocpi/ocpi/blob/release-2.3.0-bugfixes/types.asciidoc#openenum-type
The OpenAPI currently models these schemas as:
For example:
openapi-specification/ocpi/2.3.0/modules/locations/schema.yaml
Lines 868 to 885 in 7bacd82
format: open-enumis not a standard OpenAPI/JSON Schema format and does notchange the semantics of
enum. Standard validators and generated clients willtherefore reject values that are valid according to OCPI.
Affected schemas include at least:
CapabilityConnectorCapabilityConnectorTypeEnvironmentalImpactCategoryFacilityImageCategoryModuleIDParkingRestrictionParkingTypeTokenTypeVehicleTypeVersionNumberCommandTypeSuggested fix
Represent known values as documentation while keeping validation open, for
example:
Alternatively, keep
type: stringunrestricted and expose known values througha vendor extension supported by the documentation and code-generation tools.
format: open-enumandx-enumDescriptionsmay remain as non-normativedocumentation extensions.
Commands-specific consequence
The Commands Receiver interface currently exposes only five literal paths:
/commands/CANCEL_RESERVATION/commands/RESERVE_NOW/commands/START_SESSION/commands/STOP_SESSION/commands/UNLOCK_CONNECTORThis prevents an extension command represented by the normative open
CommandTypefrom being described or called by a generated client.Consider exposing
/commands/{command}with an openCommandTypepathparameter, while retaining the known command payload schemas.
2.
format: date-timedoes not encode the OCPI DateTime restrictionsThe normative OCPI DateTime differs from generic RFC 3339:
+00:00is explicitly not equivalent to UTC for OCPI;Zdesignator may be omitted;string(25).Normative definition:
https://github.com/ocpi/ocpi/blob/release-2.3.0-bugfixes/types.asciidoc#datetime-type
The OpenAPI currently uses only:
Examples occur in the common response schemas and throughout the module
schemas.
This has two interoperability effects:
+00:00, which OCPI forbids.explicitly permits.
Suggested fix
Introduce a reusable OCPI DateTime schema with:
type: stringmaxLength: 25optional
ZUse the same schema for object properties and for the
date_fromanddate_toquery parameters.
3. Generated role bundles omit the Payments module
config.jsondeclares the Payments module:openapi-specification/ocpi/2.3.0/config.json
Lines 43 to 47 in 7bacd82
However, the role configuration does not include either Payments interface:
openapi-specification/ocpi/2.3.0/config.json
Lines 64 to 90 in 7bacd82
The build script generates role documentation exclusively from these arrays.
Consequently:
payments/receiver-interface;payments/sender-interface.Payments is explicitly introduced by the OCPI 2.3.0 changelog and has a
normative module chapter.
Suggested fix
payments/receiver-interfaceto the CPO role.payments/sender-interface, or document why therole bundles intentionally exclude the PTP role.
The separate mismatch between
ModuleID, Bookings, Payments, and the normativedocumentation is already tracked by #9.
4. Two OCPI 2.3.0 interfaces declare
info.version: 2.2.1The following files have a 2.3.0 title and documentation link but declare
version 2.2.1:
openapi-specification/ocpi/2.3.0/modules/commands/sender-interface.yaml
Lines 1 to 19 in 7bacd82
openapi-specification/ocpi/2.3.0/modules/chargingprofiles/sender-interface.yaml
Lines 1 to 19 in 7bacd82
Suggested fix
Set
info.versionto2.3.0in both files.5. Version-specific
externalDocslinks point to mutable or invalid targetsMost 2.3.0 interfaces link to files under
ocpi/ocpi/blob/master, rather thanthe
release-2.3.0-bugfixesbranch.There are also invalid targets, for example the Payments interfaces reference
mod_payment.asciidoc, while the normative filename ismod_payments.asciidoc.Suggested fix
Point 2.3.0
externalDocslinks to the corresponding files under:and correct stale filenames.
Existing related issues
The following findings are intentionally not duplicated here:
CdrDimensionTypevalues: OCPI 2.3.0: CdrDimensionType #12BookingRestrictionType: Tariffs 2.3.0 #16Proposed completion criteria
CommandTypevalues can be represented.