-
Notifications
You must be signed in to change notification settings - Fork 2
feat: enable channels generator for openapi #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for the-codegen-project ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| // Generate response parsing | ||
| const responseParseCode = replyMessageModule | ||
| ? `const responseData = ${replyMessageModule}.unmarshalByStatusCode(rawData, response.status);` | ||
| ? `const responseData = ${replyMessageModule}.unmarshal(rawData);` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid TypeScript generated for array response types
High Severity
When an OpenAPI operation returns an array type (like Pet[]), the generated code produces invalid TypeScript: Pet[].unmarshal(rawData). This is syntactically invalid because you cannot call methods on type literals. The snapshot at line 1330 confirms this generates non-compiling code. This affects any OpenAPI GET operation returning arrays.
Additional Locations (1)
| channelParameters: parameterModel?.model as | ||
| | ConstrainedObjectModel | ||
| | undefined | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenAPI servers not extracted, defaults to localhost
Medium Severity
The renderHttpFetchClient call doesn't pass the servers parameter, even though OpenAPI documents define server URLs (e.g., http://petstore.swagger.io/v2 in the test spec). The generated HTTP clients default to 'localhost:3000' instead of the actual API server from the spec. Users must manually override the server for every request, defeating the purpose of defining servers in the OpenAPI document.
Note
OpenAPI HTTP client generation
channels(http_client) via newopenapi.tsand wiring inchannels/index.tsto generate per-operation fetch clientsunmarshal(...), emit common types once, and enhance integration with parameters (path building)getChannelWithParametersand refineserializeUrloutputTooling, tests, docs
channels(http_client)Written by Cursor Bugbot for commit ea148b7. This will update automatically on new commits. Configure here.