Skip to content

OpenAPI auto generated path params not merged correctly #3535

@amandesai01

Description

@amandesai01

Environment

Nitro 2.12.4
Node v22.13.1

Reproduction

Step 1:
use definePageMeta in any route.

Step 2:
make sure that openAPI object contains parameters array, even if empty.
/api/{projectId}/index.get.ts

openAPI: {
    description: 'Get a specific project by ID',
    tags: ['projects'],
    summary: 'Get project by ID',
    operationId: 'getProjectById',
    parameters: [],
  }

Step 3:
Open swagger docs and notice that path variable is not auto-populated.

Describe the bug

Nitro has this feature of auto detecting API path variables and populating them as path parameters in Open API spec. However, this feature is not working as intended.

Additional context

This can be easily fixed. Just use DEFU!!!

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions