Recognize path variables followed by :verb (AIP-136 custom methods)#944
Open
simon446 wants to merge 1 commit into
Open
Recognize path variables followed by :verb (AIP-136 custom methods)#944simon446 wants to merge 1 commit into
:verb (AIP-136 custom methods)#944simon446 wants to merge 1 commit into
Conversation
`findPathVariablesFromPath` required every `{{name}}` placeholder to be
followed by `/` or end-of-string. Paths shaped like `/tasks/{{id}}:cancel`
— AIP-136 custom methods — fell through to `findCollectionVariablesFromPath`
and were demoted to collection variables. Extend the lookahead to also
accept `:`; it's the AIP-136 boundary and is not expected inside a
path-segment literal in OpenAPI path templates, so it's a safe addition.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
findPathVariablesFromPathrequires every{{name}}placeholder to be followed by/or end-of-string. Paths shaped like/tasks/{{id}}:cancel— AIP-136 custom methods — therefore fall through tofindCollectionVariablesFromPathand are demoted to collection variables instead of path variables. Extend the lookahead to also accept:.Repro
Expected:
:idis emitted as a path variable on the resulting Postman item.Actual:
{{id}}is emitted as a collection (environment) variable; the item has no path variable forid.Fix
One-character regex change in
lib/schemaUtils.js::is the AIP-136 boundary character. It is not expected inside a path-segment literal in an OpenAPI path template, so it's a safe lookahead. Existing behavior for/{{file}}.{{format}}and similar literal-with-templates is unchanged.Tests
Two assertions added to
test/unit/util.test.jsin thefindPathVariablesFromPath functionblock, covering a single-placeholder custom method and a placeholder + custom method + trailing placeholder.References