Skip to content

feat: set ERROR_HANDLING_AJV_JOI_PARITY on openapi-backend migrations - #826

Open
gibaros wants to merge 1 commit into
mainfrom
feat/4479-ajv-joi-parity-env
Open

feat: set ERROR_HANDLING_AJV_JOI_PARITY on openapi-backend migrations#826
gibaros wants to merge 1 commit into
mainfrom
feat/4479-ajv-joi-parity-env

Conversation

@gibaros

@gibaros gibaros commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Scope

This PR touches only the charts of the five services being migrated to openapi-backend [mojaloop/project#4479] — the same five under review in the service PRs listed below. No other service's chart is modified (quoting-service, account-lookup-service, ml-api-adapter and the rest of the fleet are intentionally untouched: for them the new library behaviour is the default and no configuration is needed).

What

Sets the ERROR_HANDLING_AJV_JOI_PARITY environment variable ("true", configurable via config.error_handling_ajv_joi_parity) on the Kubernetes Deployments of the five migrating services:

Repo Chart Deployment objects touched
central-ledger centralledger/ 8 — the service and its seven handlers
central-settlement centralsettlement/ 1 — the service
bulk-api-adapter bulk-api-adapter/ 2 — the service and the notification handler
als-oracle-pathfinder als-oracle-pathfinder/ 1 — the service
event-sidecar (no standalone chart) covered via the sidecar containers embedded in the pods above; the variable is inert there since the sidecar does not use the error-handling mapper

24 files changed: 12 deployment templates + 12 values files, nothing else.

Why

central-services-error-handling 13.2.0 (mojaloop/central-services-error-handling#216) maps the ajv enum/const/format/pattern validation keywords to FSPIOP 3101 "Malformed syntax" only when this variable is true; the library default is 3100, preserving the behaviour of services already running openapi-backend/ajv.

The five migrating services return 3101 for these validation failures in production today via joi, so their charts opt in — without this variable, the migration would silently change their API error contract (Golden Path Check Settlements Error #956 asserts the production 3101 and fails without it).

Sequencing

Safe to merge before or after the service migration PRs land in chart image versions: the variable is unread by the current joi-based images, and becomes load-bearing once the openapi-backend releases (with central-services-error-handling >= 13.2.0) are deployed. Related service PRs: mojaloop/central-ledger#1291, mojaloop/central-settlement#487, mojaloop/bulk-api-adapter#148, mojaloop/event-sidecar#82, mojaloop/als-oracle-pathfinder#124.

Verification

  • helm template renders all four charts successfully; the variable appears on every enabled Deployment with value: "true"
  • Validated end-to-end on ml-core-test-harness: with the flag on the migrated services and 13.2.0 installed, Golden Path #956 passes 6/6 while the rest of the fleet (flag unset) keeps returning 3100 — zero error-code regressions across the run

… migrations [mojaloop/#4479]

central-services-error-handling 13.2.0 maps the ajv enum/const/format/pattern
validation keywords to 3101 (Malformed syntax) only when the
ERROR_HANDLING_AJV_JOI_PARITY environment variable is true; the library default is
3100, preserving the behaviour of services already running openapi-backend.

The services migrating from hapi-openapi/joi (central-ledger incl. all handler
deployments, central-settlement, bulk-api-adapter, als-oracle-pathfinder) return 3101
for these validation failures in production today, so their charts now set the flag
(configurable via config.error_handling_ajv_joi_parity, default true). The embedded
event-sidecar containers receive the same variable for uniformity; the sidecar does
not use the error-handling mapper, so it is inert there.

Verified with helm template on all four charts; Golden Path 'Check Settlements Error
#956' (which asserts the production 3101) passes against these services with the flag
enabled and central-services-error-handling 13.2.0.
@sonarqubecloud

Copy link
Copy Markdown

@gibaros gibaros changed the title feat: enable ajv/joi FSPIOP error-code parity for the openapi-backend migrations feat: set ERROR_HANDLING_AJV_JOI_PARITY on openapi-backend migrations Sep 1, 2026
@elnyry-sam-k

Copy link
Copy Markdown
Member

Looks good @gibaros ! thanks for the PR..

Only changes needed - versions of updated charts need to be updated before the merge.

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