Skip to content

Fix type_union_implicit rule for Draft 0, 1, and 2#1214

Open
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
core-fix-i-3b77d668
Open

Fix type_union_implicit rule for Draft 0, 1, and 2#1214
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
core-fix-i-3b77d668

Conversation

@staging-devin-ai-integration
Copy link
Copy Markdown

Fix type_union_implicit rule for Draft 0, 1, and 2

Summary

Fixed a bug in the type_union_implicit canonicalizer rule where incorrect vocabulary URIs were being checked for JSON Schema Draft 0, 1, and 2. The rule was checking for hyper-schema# URIs instead of schema# URIs, which caused it to not detect when enum was present, incorrectly adding a type array alongside enum.

The root cause was an inconsistency within the rule itself - lines 21-30 correctly check for schema# URIs, but lines 101-117 were checking hyper-schema# URIs for the same drafts.

Review & Testing Checklist for Human

  • Verify vocabulary URIs: Confirm that Draft 0, 1, and 2 should use schema# rather than hyper-schema# as the vocabulary identifier. This is consistent with Draft 3's check on line 96-98 which uses schema#.
  • Check for regressions: Consider if any existing schemas using Draft 0, 1, or 2 might be affected by this behavioral change. Schemas with enum will no longer get the implicit type array added.
  • Run the full test suite: Ensure all 650 tests in core.alterschema pass with no regressions.

Recommended test plan: Run make from the repository root to verify all tests pass and no formatting changes remain.

Notes

Fixed vocabulary URI checks in type_union_implicit rule that were using
hyper-schema# instead of schema# for Draft 0, 1, and 2. This caused the
rule to not detect enum keyword presence, incorrectly adding type array
alongside enum.

Also updated test expectations to reflect correct behavior where type
should not be preserved alongside enum.

Co-Authored-By: unknown <>
@staging-devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants