Summary
The 2.2.1 OpenAPI constrains identifier length but not the character set that the normative OCPI types mandate, and the tariff_id path parameter permits an empty value. As a result, values the prose spec forbids still validate against the OpenAPI.
Normative references
types.asciidoc — CiString: "Case Insensitive String. Only printable ASCII allowed. (Non-printable characters like: Carriage returns, Tabs, Line breaks, etc are not allowed)"
mod_tariffs.asciidoc — Tariff object: country_code = CiString(2), party_id = CiString(3), id = CiString(36).
Gaps in the current OpenAPI
1. CiString character set is not encoded. country_code / party_id are declared as (components/parameters.yaml, modules/tariffs/schema.yaml):
type: string
minLength: 2 # 3 for party_id
maxLength: 2 # 3 for party_id
type: string is case-sensitive UTF-8 with no charset restriction, so e.g. "é" or a value containing a line break validates — although CiString allows only printable ASCII. This applies to every CiString-typed field, not just these two.
2. tariff_id path parameter allows an empty value (modules/tariffs/parameters.yaml):
TariffIdParameter:
in: path
name: tariff_id
schema:
type: string
maxLength: 36 # no minLength -> "" is valid
An empty tariff_id is unusable as a path segment in GET/PUT/DELETE /tariffs/{country_code}/{party_id}/{tariff_id}.
Suggested fix
- Add a
pattern encoding the CiString rule (printable ASCII, no control characters), e.g. ^[\x20-\x7E]*$, to CiString-typed fields — at least to the common identifiers (country_code, party_id, id, tariff_id). The pattern must stay case-insensitive (CiString), so no [A-Z]-only regex.
- Add
minLength: 1 to TariffIdParameter (and consider Tariff.id).
Relation to existing issues
Continues the OpenAPI↔prose fidelity work in #5 (date regex), #10 (id length), #11 (currency minLength). Those did not cover the CiString character set nor the parameter layer.
Summary
The 2.2.1 OpenAPI constrains identifier length but not the character set that the normative OCPI types mandate, and the
tariff_idpath parameter permits an empty value. As a result, values the prose spec forbids still validate against the OpenAPI.Normative references
types.asciidoc— CiString: "Case Insensitive String. Only printable ASCII allowed. (Non-printable characters like: Carriage returns, Tabs, Line breaks, etc are not allowed)"mod_tariffs.asciidoc— Tariff object:country_code= CiString(2),party_id= CiString(3),id= CiString(36).Gaps in the current OpenAPI
1. CiString character set is not encoded.
country_code/party_idare declared as (components/parameters.yaml,modules/tariffs/schema.yaml):type: stringis case-sensitive UTF-8 with no charset restriction, so e.g."é"or a value containing a line break validates — although CiString allows only printable ASCII. This applies to every CiString-typed field, not just these two.2.
tariff_idpath parameter allows an empty value (modules/tariffs/parameters.yaml):An empty
tariff_idis unusable as a path segment inGET/PUT/DELETE /tariffs/{country_code}/{party_id}/{tariff_id}.Suggested fix
patternencoding the CiString rule (printable ASCII, no control characters), e.g.^[\x20-\x7E]*$, to CiString-typed fields — at least to the common identifiers (country_code,party_id,id,tariff_id). The pattern must stay case-insensitive (CiString), so no[A-Z]-only regex.minLength: 1toTariffIdParameter(and considerTariff.id).Relation to existing issues
Continues the OpenAPI↔prose fidelity work in #5 (date regex), #10 (
idlength), #11 (currencyminLength). Those did not cover the CiString character set nor the parameter layer.