Skip to content

fix(#2364): Add support for passing parameters to @ApiOperation #2365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spamshaker
Copy link

This commit introduces the ability to pass parameters directly to the @ApiOperation decorator, allowing developers to define path parameters within the decorator itself. This simplifies OpenAPI schema generation and improves developer experience by reducing boilerplate code.

Changes include:

  • Added parameters option to ApiOperationOptions type
  • Updated OperationMetadata to include parameters property
  • Modified @ApiOperation decorator to accept and store parameter metadata
  • Added tests to verify parameter handling

This change aligns with common usage patterns for OpenAPI specifications and provides a more intuitive way to define API operations with required parameters.

Changes

closes #2364

How to Review

How can a reviewer review your changes? What should be kept in mind for this review?

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

…tion

This commit introduces the ability to pass parameters directly to the @ApiOperation decorator, allowing developers to define path parameters within the decorator itself. This simplifies OpenAPI schema generation and improves developer experience by reducing boilerplate code.

Changes include:
- Added `parameters` option to ApiOperationOptions type
- Updated OperationMetadata to include parameters property
- Modified @ApiOperation decorator to accept and store parameter metadata
- Added tests to verify parameter handling

This change aligns with common usage patterns for OpenAPI specifications and provides a more intuitive way to define API operations with required parameters.

#closes openapi-ts#2364
@spamshaker spamshaker requested a review from a team as a code owner June 29, 2025 15:48
@spamshaker spamshaker requested a review from duncanbeevers June 29, 2025 15:48
Copy link

netlify bot commented Jun 29, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 3539d83

Copy link

changeset-bot bot commented Jun 29, 2025

🦋 Changeset detected

Latest commit: 3539d83

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openapi-metadata Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This commit fixes issue openapi-ts#2364 by enabling developers to specify parameters directly within the @ApiOperation decorator. This streamlines OpenAPI schema generation and improves developer experience with a more concise syntax for defining API operations that require specific input parameters.
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.

Parameters storage is not fulfilled by parameters provided in ApiOperation
1 participant