question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Duplicate path parameter definition signature found in controller...

See original GitHub issue

The new version throws an error, which I can not exactly figure out: Generate routes error. Error: Duplicate path parameter definition signature found in controller SitemapController at [method GET getJobsSitemap, getLpSitemap, getLpSitemapIndex], JobfeedController at [method GET getJobFeedsPrioBranch, getJobFeedsPrioDefault, getJobFeedsBranchRegion, getJobFeedsBranch, getJobFeedsDefault]

We have methods like this:

@Get('/jobprio-{page}-{prio}-{branch}.{format}')
	public async getJobFeedsPrioBranch(
		@Request() req: express.Request,
		@Path('page') page: string,
		@Path('format') format: JobfeedOutputs, // 'xml' | 'csv' | 'json',
		@Path('prio') prio?: JobPrioLevel | '0',
		@Path('branch') branch?: string,
		@Query('utm_campaign') utm_campaign?: string,
		@Query('utm_source') utm_source?: string,
		@Query('utm_medium') utm_medium?: string
	)
@Get('/jobprio-{page}-{prio}.{format}')
	public async getJobFeedsPrioDefault(
		@Request() req: express.Request,
		@Path('page') page: string,
		@Path('format') format: JobfeedOutputs, // 'xml' | 'csv' | 'json',
		@Path('prio') prio?: JobPrioLevel | '0',
		@Query('utm_campaign') utm_campaign?: string,
		@Query('utm_source') utm_source?: string,
		@Query('utm_medium') utm_medium?: string
	)

this worked before, and should still work right?

Sorting

  • I’m submitting a …

    • bug report
    • feature request
    • support request
  • I confirm that I

    • used the search to make sure that a similar issue hasn’t already been submit

Expected Behavior

the routes should be computed correctly.

Current Behavior

throws error

Possible Solution

not quite sure yet where the error is coming from…maybe from the path parameters?

Steps to Reproduce

add two methods with different dynamic path paramters. (see example above)

Context (Environment)

Version of the library: 3.5.0 Version of NodeJS: 15.2.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
simllllcommented, Jan 19, 2021

This got introduced in https://github.com/lukeautry/tsoa/pull/829

It seems my case has just not been covered. @jackey8616 do you have an idea how we could solve this nicely?

0reactions
simllllcommented, Jan 20, 2021

Ah great, you changed it to a warning. Like that too, if you find time please also check my PR, it improves the detection and makes it more bullet proof 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.NET - Swagger duplicates path and query parameters
It is worth noting that, normally, if the parameter has the same name in the path and as a variable it should not...
Read more >
"Not supported by Swagger 2.0: Multiple operations with path ...
Hm... I see in the README that Swagger 2.0 does not include the query string component when mapping a URL to an action....
Read more >
LI81796: API DESIGNER GENERATES DUPLICATE ... - IBM
API Designer generates duplicate entries for path parameters when the same parameter is also defined the global API setup.
Read more >
Swagger RESTful API Documentation Specification
In the Swagger specification, the data types are used in several locations - Operations, Operation Parameters, Models, and within the data types themselves ......
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
The value for these path parameters MUST NOT contain any unescaped ... keyword within Schema Objects contained within this OAS document.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found