-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
fix(zmodel): don't inherit @@map
attribute from base
#1172
Conversation
WalkthroughWalkthroughThis update introduces improvements and fixes in handling schema generation, particularly addressing issues with delegating models and Changes
Assessment against linked issues
Related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/schema/src/utils/ast-utils.ts (3 hunks)
- tests/integration/tests/regression/issue-1167.test.ts (1 hunks)
Additional comments: 4
tests/integration/tests/regression/issue-1167.test.ts (1)
- 3-19: The test setup and schema definition correctly replicate the issue described in Delegating models can't use
@@map()
#1167. However, it's recommended to add assertions to verify that the schema is loaded correctly and that the@@map
attribute is handled as expected, ensuring the fix resolves the issue without introducing new ones.packages/schema/src/utils/ast-utils.ts (3)
- 31-31: The addition of the
isAbsolute
import fromnode:path
is appropriate for enhancing path handling in theresolveImportUri
function.- 71-72: The modification to exclude the
@@map
attribute from being inherited by derived models in themergeBaseModel
function is crucial for resolving the issue described in the PR objectives. This change effectively prevents the duplication and conflict observed with the@@map
attribute during schema generation.- 147-148: The adjustments to the
resolveImportUri
function to handle relative and absolute paths more clearly are a significant improvement. By using theisAbsolute
function, the path handling becomes more accurate and robust, enhancing the framework's ability to resolve schema imports correctly.
Fixes #1167
Summary by CodeRabbit