Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument of type '"options"' is not assignable to parameter of type 'Method' #55

Open
kyng-cytro opened this issue Oct 24, 2024 · 0 comments

Comments

@kyng-cytro
Copy link
Contributor

I get this type-error when I generate.

    2781 |     ...params: MaybeOptionalArg<z.infer<TEndpoint["parameters"]>>
    2782 |   ): Promise<z.infer<TEndpoint["response"]>> {
  > 2783 |     return this.fetcher("options", this.baseUrl + path, params[0]) as Promise<z.infer<TEndpoint["response"]>>;
         |                         ^^^^^^^^^
    2784 |   }
    2785 |   // </ApiClient.options>
    2786 | }

I have a feeling it has something to do with the fact that options is missing here

export type Method = "get" | "head" | MutationMethod;

My quick fix has been to add it in manually after I generate.

export type MutationMethod = "post" | "put" | "patch" | "delete";
export type Method = "get" | "head" | "options" | MutationMethod;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant