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
As an example, say you have a POST endpoint defined as:
POST /api/notes/id/{id}
that expects a body that looks like:
{
id: 1,
text: 'xyz'
}
Because the path and the body have a property with the same name, it ends up breaking. In this example, "id" gets put in the path, but then gets removed from the body payload that gets sent in the request.
I narrowed this down to being a problem in getFetchParams(), where the getPath() function ends up deleting keys from the payload. The way the code is written, I see why this is a necessity. I am wondering if there are any suggestions?
One thought I had was to add a third optional parameter to the function that create() returns that can be an array of strings for "keys to persist into body payload"
As an example, say you have a POST endpoint defined as:
POST /api/notes/id/{id}
that expects a body that looks like:
Because the path and the body have a property with the same name, it ends up breaking. In this example, "id" gets put in the path, but then gets removed from the body payload that gets sent in the request.
I narrowed this down to being a problem in
getFetchParams()
, where thegetPath()
function ends up deleting keys from the payload. The way the code is written, I see why this is a necessity. I am wondering if there are any suggestions?One thought I had was to add a third optional parameter to the function that create() returns that can be an array of strings for "keys to persist into body payload"
openapi-typescript-fetch/src/fetcher.ts
Line 51 in b62ee71
The text was updated successfully, but these errors were encountered: