You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an operation contains two parameters with the same name but different locations (in), types will only be generated for one of the parameters. According the OpenAPI Specification v3.0.3, "a unique parameter is defined by a combination of a name and location" (source).
Name
Version
openapi-typescript
6.7.3
Node.js
18.16.1
OS + version
Ubuntu 23.10
Reproduction
Using the schema below, you will see that a parameter type is only generated for the parameter with in: path.
openapi: 3.1.0info:
title: Sample APIversion: 0.1.9license:
{"name": "Sample License","identifier": "Sample-License","url": "https://license.foobar.com",}servers:
- url: http://api.foobar.com/v1paths:
/users/{userId}:
get:
security:
- {}operationId: retrieveUsersummary: Returns a user by ID.parameters:
- name: userIdin: queryrequired: truedescription: The ID of the user to return.schema:
type: integerformat: int64minimum: 1
- name: userIdin: pathrequired: truedescription: The ID of the user to return.schema:
type: integerformat: int64minimum: 1responses:
"200":
description: A user object.content:
application/json:
schema:
type: objectproperties:
id:
type: integerformat: int64example: 4name:
type: stringexample: Jessica Smith"400":
description: The specified user ID is invalid (not a number)."404":
description: A user with the specified ID was not found.default:
description: Unexpected error
Expected result
A type is generated for BOTH parameters, despite their non-unique names.
Checklist
My OpenAPI schema passes the Redocly validator (npx @redocly/cli@latest lint)
Description
If an operation contains two parameters with the same
name
but different locations (in
), types will only be generated for one of the parameters. According the OpenAPI Specification v3.0.3, "a unique parameter is defined by a combination of a name and location" (source).openapi-typescript
6.7.3
18.16.1
Ubuntu 23.10
Reproduction
Using the schema below, you will see that a parameter type is only generated for the parameter with
in: path
.Expected result
A type is generated for BOTH parameters, despite their non-unique names.
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: