-
-
Notifications
You must be signed in to change notification settings - Fork 114
Allows enum types for id fields #1010
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
Conversation
Thank you for working on the fix and clean-up @Ustice ! |
packages/schema/src/language-server/validator/datamodel-validator.ts
Outdated
Show resolved
Hide resolved
packages/schema/src/language-server/validator/datamodel-validator.ts
Outdated
Show resolved
Hide resolved
Important Auto Review SkippedAuto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the 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 (
|
This PR fixes an issue where enum types were being marked as invalid for id fields.
Also, I improved
SchemaLoadingError
, so that it shows the source of the error in jest, rather than inside the utility function. In addition, you can pass it an array of errors rather than strings. (It will still take those too!)I also created the
safelyLoadModel
utility function, which usesPromise.allSettled
to get a result that you can usetoMatchObject
, which allows for easier pattern-matching of complex responses.For
packages/schema/tests/schema/validation/datamodel-validation.test.ts
, I broke up the expect calls into their own tests for easy identification of what went wrong when something breaks. They will of course show up as individual tests in the errors.