openapi-fetch version
0.14.0
Description
When there is an endpoint with ID parm - /actions/{id}
and it accepts params.path.id: string - in that case ID equal to '' (empty string)
Then openapi-fetch implicitly parses endpoint to /actions and for types connected with ActionDto I get implicitly ActionDto[]
Reproduction
export const getAction = async ({ params }: ActionParams) => {
const { data, error, response } = await fetchClient.GET('/actions/{id}', { params });
return data;
}
getAction({ params: { path: { id: '' } } }) // => [ActionObj, ActionObj]
Expected result
export const getAction = async ({ params }: ActionParams) => {
const { data, error, response } = await fetchClient.GET('/actions/{id}', { params });
return data;
}
getAction({ params: { path: { id: '' } } }) // => Error404 or whatever the API returns
Extra
openapi-fetch version
0.14.0
Description
When there is an endpoint with ID parm -
/actions/{id}and it accepts
params.path.id: string- in that case ID equal to''(empty string)Then openapi-fetch implicitly parses endpoint to
/actionsand for types connected withActionDtoI get implicitlyActionDto[]Reproduction
Expected result
Extra