Send "types+transform" to hey-api-openapi-ts when useDateType is enabled
Resolves: #137
I'm a bit unsure of how to test that it works correctly, do you have any idea´s?
After fiddeling around a bit, it does not look like a responseTransformer is generated..
I added
born:
type: string
format: date-time
to pet and --useDateType to generate:api the type changes to Date in the definition, but no transformer is generated
Is there some way to attach a debugger when generating code?
Is there some way to attach a debugger when generating code?
@AnderssonPeter
By outputting the source map during the build with a command like tsc -p tsconfig.json --sourceMap and creating the following launch.json in VSCode, you can attach the debugger.
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch via npm",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/examples/react-app",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"generate:api"
]
}
]
}
What is the status of this PR?
is there anyway to add the date transformers in the current codegen version?
@7nohe I have tried your suggestions above, but sadly no transformation code is generated.
I see that this project uses a old version of @hey-api/openapi-ts, the current version uses plugins to add transformations.. the question is if that would solve the issue or not?
So something must be missing as just setting config.types.dates to types+transform does not generate the needed code.
FYI: @maniator