Replace fixed JSON struct tags for bpp_uri and bap_uri with a map-based parse of the context object. A new getContextString() helper checks the snake_case key first and falls back to the camelCase key, so routing works transparently for both the legacy beckn spec and the new camelCase convention. Also adds a nil-context guard so a missing context field returns a clear error instead of a panic. Test coverage: - Two new cases in TestRouteSuccess for bppUri and bapUri camelCase payloads - TestGetContextString: 5 table-driven cases covering snake, camel, precedence, missing, and empty-snake-fallthrough scenarios - TestRouteNilContext: confirms clear error on missing context field Fixes #636 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 KiB
26 KiB