Giter Site home page Giter Site logo

Comments (7)

Nick-Lucas avatar Nick-Lucas commented on September 27, 2024 1

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

export const createQuerySerializer = <T = unknown>({

from openapi-ts.

AndreasJJ avatar AndreasJJ commented on September 27, 2024 1

Thanks for the quick fix, it works for us now.

from openapi-ts.

stackblitz avatar stackblitz commented on September 27, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

from openapi-ts.

mrlubos avatar mrlubos commented on September 27, 2024

@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.

AndreasJJ avatar AndreasJJ commented on September 27, 2024

@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.

mrlubos avatar mrlubos commented on September 27, 2024

@AndreasJJ Ugh. This is with the example above? I'll check, sorry for that

from openapi-ts.

mrlubos avatar mrlubos commented on September 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.