Commit Graph

7 Commits

Author SHA1 Message Date
Mayuresh
1be757a165 fix(reqpreprocessor): support camelCase context attributes for beckn spec migration
- Add transactionId and messageId as camelCase aliases in model.go contextKeys map,
  pointing to the same ContextKeyTxnID and ContextKeyMsgID constants. This allows
  adapter configs to reference either form without failing startup validation.

- In reqpreprocessor, add firstNonNil() helper for subscriber/caller ID lookups
  so bap_id/bapId and bpp_id/bppId are both resolved correctly regardless of
  which beckn spec version the payload uses. snake_case takes precedence when both
  are present.

- Add snakeToCamel() helper used in the context key loop so a single config entry
  (e.g. transaction_id) automatically also checks the camelCase form (transactionId)
  without requiring any config file changes.

- Add TestSnakeToCamel, TestCamelCaseSubscriberID, TestCamelCaseContextKeys to
  cover all new code paths.

Fixes #637

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 15:40:36 +05:30
ameersohel45
3b59507f15 ref: improve error handling in extended schema validation 2025-12-14 23:07:58 +05:30
ameersohel45
cd49b7dda9 ref: enhance schema validation logic and skip core schema 2025-12-14 21:49:51 +05:30
ameersohel45
f0ccef9e59 fix: remove redundant code 2025-12-12 17:21:02 +05:30
ameersohel45
f6b32ef2f2 fix: error handling in extended schema 2025-12-12 17:21:02 +05:30
ameersohel45
5843d2a760 update: logs and comments also ref refreshLoop method 2025-12-12 17:21:02 +05:30
ameersohel45
5feb84196c ref: Split Extended Schema logic and rename variables 2025-12-12 17:21:02 +05:30