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
When an operation has only optional parameters are defined, the generated operation typings still output parameters as a required property, even though all properties within are optional. This means that when using the schema with openapi-fetch, I have to pass { parameters: {} } instead of just {} if I don't want to pass any of the optional parameters.
Name
Version
openapi-typescript
6.5.5
Node.js
18.17.0
OS + version
macOS 13.5.1
Reproduction
Generate typings for a path with only optional parameters, e.g.:
denisw
changed the title
"parameters" is required property even if all parameters are optional
"parameters" is a required property even if all parameters are optional
Sep 8, 2023
duncanbeevers
added a commit
to duncanbeevers/openapi-typescript
that referenced
this issue
Sep 11, 2023
Description
When an operation has only optional parameters are defined, the generated operation typings still output
parameters
as a required property, even though all properties within are optional. This means that when using the schema withopenapi-fetch
, I have to pass{ parameters: {} }
instead of just{}
if I don't want to pass any of the optional parameters.openapi-typescript
6.5.5
18.17.0
macOS 13.5.1
Reproduction
Generate typings for a path with only optional parameters, e.g.:
Expected result
I would expect
parameters
to be optional in the generated operation type, like this:Instead,
parameters
is defined as a required property.Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: