Watch mode throws error when local server reloads #1534
Labels
bug 🔥
Something isn't working
prioritized 🚚
This issue has been prioritized and will be worked on soon
Description
When running in watch mode with an endpoint that is local, openapi-ts will exit with an error if the openapi endpoint serving the specification temporarily goes down. This is a ResolverError and occurs when calling sendRequest in @hey-api/json-schema-ref-parser/lib/resolvers/url.ts.
I am working in a monorepo and the endpoint in http://localhost:3001/api/swagger-json which is served by NestJS. When reloading, the server will temporarily stop running the HTTP server and the request fails to connect resulting in an error that is caught by the try/catch block.
I'm not sure what the correct solution would be here. Does this need to be run with an NGINX proxy in front of the server or could we add an option to ignore failure to connect until the server comes back online?
I'm unable to grab the problematic code as its in a client's isolated network.
Reproducible example or configuration
https://stackblitz.com/edit/hey-api-client-fetch-example
OpenAPI specification (optional)
No response
System information (optional)
Using a PNPM monorepo in an Kubernetes Alpine container.
The text was updated successfully, but these errors were encountered: