Skip to content

Incorrect type inference for optional query parameters on POST/PUT/PATCH methods #72

@kalaztaja

Description

@kalaztaja

Hi,

The CreateFetch type method incorrectly determines the signature of the .create() method for POST, PUT, PATCH, and DELETE requests. When an operation has optional query parameters, the type system fails to infer them, resulting in a type for .create() that expects zero arguments.

Repository with minimal reproduction

Link to the repository: https://github.com/kalaztaja/openapi-fix

Follow the readme to reproduce the bug.

PR to fix the bug
Link to the PR: #74

Please review my proposal and if so, feel free to merge the pull request!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions