I have a nasty bug using openapi-client-axios in react-openapi-axios:
const { api } = useContext(OpenAPIContext)
const { data, error, loading, response } = useOperation('getUsers') // works as expected
return (
<>
{!done && <Form
heading="Create New User"
ready={!!password && !!name && !done}
ok={() => {
api.getClient().then(client => {
console.log('CREATE-USER', { client })
// the following line works as expected
client.paths['/user'].post(null, { id: name, key: password })
// the following line creates a GET request instead of a POST request
//client.createUser(null, { id: name, key: password })
})
}}
>
The relevant part of the API-JSON (full file attached in api-json.log):
I have a nasty bug using
openapi-client-axios
inreact-openapi-axios
:The relevant part of the API-JSON (full file attached in api-json.log):
The API is generated in NestJS by the controller specification:
Calling
client.createUser(null, { id: name, key: password })
generates a GET request with parameterundefined
instead of a POST request:Calling
client.paths['/user'].post(null, { id: name, key: password })
works as expected.