Comments (7)
This strikes me as more of a client bug. When you pass a Date to a body, it gets serialised to an ISO string automatically by every client I've used.
It looks like the createQuerySerializer
needs updating to identify Date and call .toISOString()
on it
openapi-ts/packages/client-fetch/src/utils.ts
Line 261 in 37a991a
from openapi-ts.
Thanks for the quick fix, it works for us now.
from openapi-ts.
Start a new pull request in StackBlitz Codeflow.
from openapi-ts.
@Nick-Lucas do you think we should add request transformers? Or not allow passing Date(s) into requests and require users to transform them into strings?
from openapi-ts.
@mrlubos I updated @hey-api/openapi-ts to ^0.52.3 and @hey-api/client-fetch to ^0.2.2, but the resulting request url is now on the format https://test.com/test?2024-08-03T21:59:59.999Z&2024-08-10T21:59:59.999Z. So it's correctly serializing the date to a string now, but it's not including the query parameter name.
from openapi-ts.
@AndreasJJ Ugh. This is with the example above? I'll check, sorry for that
from openapi-ts.
@AndreasJJ I am not sure which path I tested the last time, but the new fix works with your example. Will fix whatever it might be breaking if that's the case
from openapi-ts.
Related Issues (20)
- Improper handling of array query types HOT 6
- Having trouble setting up client with next js and fetch api HOT 4
- Properties are declared `?` when they're not in the openapi spec HOT 5
- Type of error object changed HOT 2
- Cannot specify responseTransformer when request options include headers HOT 1
- Generating code based on multiple OpenAPI schemas HOT 3
- Automatic addition of the suffix `Schema` to the object names in `schemas.gen.ts` causes conflicts with `types.gen.ts` HOT 3
- Intergrate with `msw` mock service HOT 1
- Improve changelog
- Test bundle-require
- Angular client
- Posibility to add no client HOT 14
- Big int for Format int64 HOT 1
- Build Error in @hey-api/client-fetch v0.3.2: Unnamed ‘Client’ and ‘RequestOptionsBase’ Issues HOT 9
- Dynamic require of "child_process" is not supported HOT 3
- openapi-ts version 0.53.3 breaks esm build HOT 1
- Generating names with search parameters from URL HOT 5
- `@tanstack/react-query` is not compatible with `asClass` services HOT 5
- @hey-api/[email protected] doesn't export type RequestResult HOT 2
- @hey-api/client-fetch is incompatible with `asClass: true`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-ts.