Skip to content

fix(explorer): pass version to operationIdFactory for all versioning types#3783

Open
maruthang wants to merge 1 commit intonestjs:masterfrom
maruthang:fix/operationid-version-all-types-3268
Open

fix(explorer): pass version to operationIdFactory for all versioning types#3783
maruthang wants to merge 1 commit intonestjs:masterfrom
maruthang:fix/operationid-version-all-types-3268

Conversation

@maruthang
Copy link
Copy Markdown

PR Checklist

PR Type

  • Bugfix

What is the current behavior?

The operationIdFactory callback only receives the version parameter when using URI/path versioning. For HEADER, MEDIA_TYPE, and CUSTOM versioning types, the version parameter is always undefined.

Issue Number: #3268

What is the new behavior?

Added getNonPathVersion() method that reads version from the @Version() decorator metadata or falls back to defaultVersion from versioning options for non-URI versioning types. This version is passed to getOperationId when no path-based version is found.

5 regression tests added covering HEADER, MEDIA_TYPE, CUSTOM versioning types and the default operationIdFactory.

Does this PR introduce a breaking change?

  • No

…types

operationIdFactory only received version for URI/path versioning.
For HEADER, MEDIA_TYPE, and CUSTOM versioning, version was always
undefined. Read version from @Version() decorator metadata or
defaultVersion as fallback for non-URI versioning types.

Closes nestjs#3268
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.

1 participant