Skip to content

fix fixture path losing suffix after dynamic ID substitution#1549

Open
knQzx wants to merge 1 commit intostripe:masterfrom
knQzx:fix-fixture-path-verify
Open

fix fixture path losing suffix after dynamic ID substitution#1549
knQzx wants to merge 1 commit intostripe:masterfrom
knQzx:fix-fixture-path-verify

Conversation

@knQzx
Copy link
Copy Markdown
Contributor

@knQzx knQzx commented Apr 16, 2026

Fixes #1340

When using dynamic IDs in fixture paths like /v1/customers/${customer:id}/sources/${bank_account:id}/verify, the /verify suffix was stripped during ID resolution

The bug was in ParsePath in pkg/parsers/parsers.go - the condition for appending the trailing path segment after the last regex match used len(pathParts)%2 == 0, which only works when there is exactly one dynamic ID in the path. With two or more dynamic IDs the modulo check fails and the trailing segment is dropped

Changed the condition to len(pathParts) > len(matches), which correctly appends the trailing segment regardless of how many dynamic IDs appear in the path

Added a test case covering two dynamic IDs with a trailing path suffix

@knQzx knQzx requested a review from a team as a code owner April 16, 2026 17:15
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.

Bank account verify using a fixture removes /verify from the path when using dynamic IDs

1 participant