Uh oh!
There was an error while loading. Please reload this page.
docs: Document strict validation for newer drafts - #19
Merged
Conversation
Strict mode was documented as "Draft 6 only", which has been out of date since 6.10.0 added the Draft 2019-09 constraint set. Add a dedicated Strict mode page covering: - what CHECK_MODE_STRICT actually does (selects a draft-specific constraint set from the $schema keyword) - which drafts support it: Draft 6, Draft 7 and Draft 2019-09 - the Draft 6 fallback for schemas without $schema, and changing it with Factory::setDefaultDialect() and the DraftIdentifiers constants - the InvalidArgumentException thrown for unsupported drafts such as Draft 2020-12 - the keyword differences between the dialects, including that `dependencies` is silently ignored under Draft 2019-09 Also repairs the surrounding examples, which did not run: `$jsonSchema->$id` was a variable-variable rather than the $id property, `$jsonSchemaObject` was undefined in three snippets, and the strict mode snippet used Constraint without importing it. The stray H1 mid-page kept the section out of the sidebar table of contents. Closes#18 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Drop the "Unsupported drafts throw" and "Differences between the dialects" sections. Both leaned on internals rather than on how to use the library, which is more detail than this page needs. The supported drafts table already tells readers which dialects strict mode covers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#18
Strict mode was documented as "Draft 6 only", which has been out of date since 6.10.0 added the Draft 2019-09 constraint set.
New page: Strict mode
A dedicated
_docs/strict-mode.md(nav priority 18, between Check mode and Advanced topics) covering:CHECK_MODE_STRICTactually does — it selects the constraint set of one specific draft (the dialect) based on the schema's$schemakeyword, rather than being a "stricter" flavour of normal validation.$schema— Draft 6 by default, changeable viaFactory::setDefaultDialect()using theJsonSchema\DraftIdentifiersconstants.Other changes
advanced-topics.md— removed the stale "Validating using strict mode (Draft 6 only)" section in favour of a pointer to the new page. It also used an#H1 mid-page, which kept it out of the sidebar table of contents (config/docs.phpsetsmin_heading_levelto 2).check-mode.md— theCHECK_MODE_STRICTrow read "Validate the schema using strict mode", which describes whatCHECK_MODE_VALIDATE_SCHEMAdoes. Reworded, and linked to the new page.$jsonSchema->$id(a variable-variable, not the$idproperty),$jsonSchemaObjectundefined in three snippets, andConstraintused without an import.Verification
Every claim was executed against
jsonrainbow/json-schemaat 6.10.0 rather than read off the source:dependentRequiredviolation; without strict mode the same document passesFactory::getDefaultDialect()is Draft 6;setDefaultDialect(DRAFT_2019_09)changes the outcome for a schema with no$schema; a$schemakeyword wins over the default dialectThe site builds cleanly, the sidebar orders Getting started → Check mode → Strict mode → Advanced topics, and all table-of-contents anchors and cross-page links resolve.
_site/build output is intentionally not included, since the Pages workflow rebuilds from source on push tomain.🤖 Generated with Claude Code