Duplicate identifier for parameters with the same name but different location/in
See original GitHub issueI am using an OpenAPI v3 spec generated by NSwag where the Parameters Object of one of the Operations has two parameters with the same name, but with different Locations (“in”: “query” vs. “in”: “path”)
According to the spec, this should be valid: “A unique parameter is defined by a combination of a name and location.”
When I generate code for this spec, the code has a typescript error “error TS2300: Duplicate identifier”.
...
"/MyPath/{myParam}": {
"get": {
...,
"parameters": [
{
"name": "myParam",
"in": "query",
"schema": {
"type": "string",
"nullable": true
},
"x-position": 1
},
{
"name": "myParam",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"x-position": 2
}
],
...
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Duplicate identifier when declaring types with same name in ...
I have a simple TypeScript 'snippets' project, and I've run into an issue where multiple .ts files will have the same type names...
Read more >Customizing the Duplication Identifier - Oracle Help Center
The duplicate's name must incorporate the name of the original, but you can replace (copy) with another duplicate identifier and change its location...
Read more >How to find duplicates in Excel: identify, highlight, count, filter
The tutorial explains how to search for duplicates in Excel. You will learn a few formulas to identify duplicate values or find duplicate...
Read more >Change page, section, figure, etc identifier avoiding duplicates
The anchor name page.<n> is used for several purposes; since you have several “page 1”, the only way seems to add the option ......
Read more >Documentation - TypeScript 2.0
strictNullChecks switches to a new strict null checking mode. ... type) at any given location for a local variable or parameter that is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good point @jesperkristensen will schedule this for the next release
Seeing a similar issue here:
and:
Both are output as
userId
on the options object because they have a similar “name” property. But one is in the header and one is in the path.