openapi-typescript-fetch
openapi-typescript-fetch copied to clipboard
feat: Explode query string
trafficstars
🐸 Problem to Solve
OpenAPI 3 accepts parameters whose schema is an object.
When passing data to a fetch function, nested query values get stringified as [object Object].
👑 Solution
This change extends the existing query params encoder. It can now express nested objects and arrays in addition to scalar values.
It uses the form-style query parameter encoding which is the default style for query parameters.

🔧 Changes (and non-Changes)
- scalars are encoded as before
- lists are still exploded; however…
- lists are exploded recursively
- objects are exploded recursively
I included a bunch of examples in the tests for the src/explodeQueryFormStyle.ts utility.
I also added validation of url-encoding behavior in the fetcher tests.
👋
is this library still being maintained ?