Skip to content

Don't lint $ref siblings for default/examples in legacy drafts#610

Open
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
evalon/blaze-dont-b9fbacd6
Open

Don't lint $ref siblings for default/examples in legacy drafts#610
staging-devin-ai-integration[bot] wants to merge 1 commit intomainfrom
evalon/blaze-dont-b9fbacd6

Conversation

@staging-devin-ai-integration
Copy link

Skip default/examples $ref sibling linting in legacy drafts

Summary

This PR updates the ValidDefault and ValidExamples linter rules to respect JSON Schema draft semantics around $ref siblings:

  • Draft-07 and older: if a schema object has $ref, the linter now skips validating/removing sibling default / examples (since those siblings must be ignored by implementations).
  • 2019-09 / 2020-12: the linter continues to evaluate those siblings and remove invalid values.

It also adds regression tests for both rules covering:

  • Draft-07 $ref sibling preservation
  • 2019-09 invalid $ref sibling removal
  • 2020-12 invalid $ref sibling removal

Review & Testing Checklist for Human

  • Confirm the dialect gating logic (metadata vocab checks) matches intended draft behavior for all supported legacy drafts (draft-04, draft-06, draft-07) and does not accidentally skip modern drafts.
  • Review the new tests to ensure they encode the exact requirement: preserve invalid default/examples beside $ref in Draft-07, but remove them in 2019-09 and 2020-12.
  • Run a quick manual spot-check with a schema using $ref + invalid metadata siblings across drafts (07 vs 2019-09/2020-12) to verify transform output end-to-end matches expectations.

Notes

Co-Authored-By: bot_apk <apk@cognition.ai>
@staging-devin-ai-integration
Copy link
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