Skip to content

Pass reviver when parsing JSON #2553

@danbluhmhansen

Description

@danbluhmhansen

Description

Hello there, I am using the Temporal API quite a bit and would like to be able to parse dates from my API straight to those types in JS/TS.

I have implemented a transform so the date types from my API gets the correct Temporal types, but the actual string values cannot be parsed straight from JSON, they have to go through a reviver like in this example Temporal.Instant - JSON serialization and parsing.

I would like to be able to provide such a reviver for the openapi-fetch Client, or perhaps on a per path basis.

Proposal

main...danbluhmhansen:openapi-typescript:main

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions