Added the zod schemas for all the API methods#118
Open
cb-alish wants to merge 7 commits into
Open
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cb-srinaths
requested changes
May 11, 2026
| @@ -0,0 +1,11 @@ | |||
| // Generated Zod validator: Addon.copy | |||
Collaborator
There was a problem hiding this comment.
I'd suggest generating all the schemas in the src/schema directory with the <resource>.schema.ts file name. This keeps it consistent with the naming pattern, and eventually allows us to add a export type Addon = z.infer<Addon> in the same file.
Collaborator
Author
There was a problem hiding this comment.
Hi @cb-srinaths, I have addressed this. Would you please re-review once?
| // Do not edit manually – regenerate via sdk-generator | ||
|
|
||
| import { z } from 'zod'; | ||
| const copyAddonBodySchema = z.looseObject({ |
Collaborator
There was a problem hiding this comment.
I'd suggest pascal case for these schema declarations as our types are pascal cased.
Collaborator
Author
There was a problem hiding this comment.
Hi @cb-srinaths, Yes that makes sense. I have changed this to pascal case.
…r output Replace src/validation/<resource>/<action>.validation.ts with flat src/schema/<resource_snake>.schema.ts (and shared.schema.ts), matching the sdk-generator VALIDATOR_ZOD layout. Each file aggregates all body/query schemas for that resource and exports z.infer-derived types per action. - Point validationLoader at ./schema/<resource_snake>.schema.js (CJS build). - Resolve exports using PascalCase body const names aligned with ZodNamingStrategy.bodySchemaName in sdk-generator. Regenerated from the same OpenAPI spec via sdk-generator; requires the paired validator emitter changes in sdk-generator.
4246a8b to
c14c44c
Compare
…o API call time Replace manual createRequire-based module resolution with native dynamic import(), allowing TypeScript compiler to handle ESM/CJS transpilation automatically. Schema loading is now deferred to API call time (lazy), preserving synchronous SDK initialization while maintaining validation functionality in both module systems. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Node.js automatically caches imported modules, making the manual Map-based cache redundant. This simplifies the code while maintaining the same performance characteristics. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
All the necessary schemas for the zod validation.