Node API: allow retry/timeout functionality
Description
My backend server has a cold start and have added a generation of sdk in monorepo and on every pnpm dev of the monorepo it fails cause it cant fetch the json, can we have control on the timeout or have retryFor
import { defineConfig } from "@hey-api/openapi-ts";
export default defineConfig({
name: "abcSDK",
input:
"https://example.com/openapi.json",
output: "src",
format: "prettier",
timeout: 300, // New Field
retryFor: 3, // New Field
});
OpenAPI specification (optional)
No response
Configuration
import { defineConfig } from "@hey-api/openapi-ts";
export default defineConfig({
name: "abcSDK",
input:
"https://example.com/openapi.json",
output: "src",
format: "prettier",
timeout: 300, // New Field
retryFor: 3, // New Field
});
System information (optional)
No response
https://github.com/hey-api/openapi-ts/blob/04f31ff45ac382e4cb464f77408826f904dc004d/packages/openapi-ts/src/utils/getOpenApiSpec.ts#L14
This File Might have some way to fix is what I guess, not sure
Hey @abhay-ramesh, while I see the problem, this really isn't a bug, but a feature request. I'll need to think about this, but definitely wouldn't want to extend the API surface to accommodate this feature. It sounds like you could achieve this using Node API? I haven't tested it yet so can't tell you whether it's possible today, but that's where you could implement a timeout/retry however you like