Closed
Description
Hi, love this initiative. It's allowed me to remove hundreds of lines of code.
I've got a strange problem trying to wire up a POST request using the standard approach:
export const submitForm = fetcher.path('/form/{formId}/submit').method('post').create();
The Swagger API definition requests formId
as a parameter and formFields as the post body, but the returned function requests the following input, a intersection between an object and an array, which is impossible to provide:
I might be doing something wrong, but it seems like a potential bug. Here's the type for the request:
"/form/{formId}/submit": {
post: {
parameters: {
path: {
formId: string;
};
};
responses: {
/** Success */
200: {
content: {
"text/plain": components["schemas"]["FormModel"];
"application/json": components["schemas"]["FormModel"];
"text/json": components["schemas"]["FormModel"];
};
};
};
requestBody: {
content: {
"application/json":
| components["schemas"]["FormFieldInputModel"][]
| null;
"text/json": components["schemas"]["FormFieldInputModel"][] | null;
"application/*+json":
| components["schemas"]["FormFieldInputModel"][]
| null;
};
};
};
};