Exclude Unsupported type fields from ORM client typing and runtime validation#2448
Exclude Unsupported type fields from ORM client typing and runtime validation#2448Copilot wants to merge 3 commits into
Conversation
…lidation Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
|
@copilot , zod tests are failing |
…lugins property) Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
|
@claude review |
|
Claude finished @ymc9's task —— View job Code Review - Excluding Unsupported Type FieldsReviewing the PR changes to exclude Unsupported type fields from ORM client typing and runtime validation. Tasks:
Review SummaryThe implementation correctly excludes ✅ Strengths
🔍 Technical AnalysisType System Changes: The utility type modifications in Runtime Schema Generation: The Zod factory changes ensure runtime validation rejects any attempts to use Filter Handling: Line 657 returns 🟡 Minor Observations
✅ Requirements Compliance
Verdict: APPROVED ✅This is a well-implemented solution that correctly addresses the requirement to exclude |
ymc9
left a comment
There was a problem hiding this comment.
Also, add a separate e2e test file for "Unsupported" field behavior under "tests/e2e/orm/client-api". Verify ORM runtime behavior and input/output typing.
| fields[field] = this.makeRelationSelectIncludeSchema(model, field, options).optional(); | ||
| } | ||
| } else { | ||
| } else if (fieldDef.type !== 'Unsupported') { |
There was a problem hiding this comment.
instead of adding a condition here, filter the fields used on the loop. Consider if you should extract a helper method for such filtering.
packages/schema/src/schema.tsto excludeUnsupportedtype fields fromScalarFieldsandNonRelationFieldsTypeScript utility typespackages/orm/src/client/zod/factory.tsto skipUnsupportedtype fields inmakeCreateDataSchema,makeUpdateDataSchema,makeSelectSchema,makeOmitSchema,makeOrderBySchema, andmakeDistinctSchematests/e2e/orm/client-api/zod.test.tsto verify that Unsupported fields are excluded from create/update/select/orderBy Zod schemasplugins: {}required bySchemaDef)Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.