Skip to content
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

Improve the diagnostic for when a schema is unsupported #164

Merged

Conversation

czechboy0
Copy link
Contributor

Motivation

Previously, when a schema that was, or contained a subschema that was, unsupported, adopter would get a pretty opaque warning diagnostic telling them the "schema is unsupported", without more details of why, and which part of it.

Modifications

This PR moves from a simple Boolean status on the isSchemaSupported class of utility functions, and moves to a richer enum, which includes the reason and the schema itself when unsupported, leading to much more informative diagnostics.

Result

Diagnostics emitted for unsupported schemas will be a lot more meaningful.

Test Plan

Adapted the unit tests to make sure all the reasons for unsupported schemas are now tested, and the reason matches.

@czechboy0 czechboy0 merged commit 3c0fcab into apple:main Aug 2, 2023
@czechboy0 czechboy0 deleted the hd-improve-schema-unsupported-diagnostic branch August 2, 2023 14:08
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants