Skip to content

fix(schemas): follow-ups to the JSON Schemas (#522) - #523

Merged
wstein merged 3 commits into
mainfrom
fix/268-schema-lows
Oct 9, 2026
Merged

wstein merged 3 commits into
mainfrom
fix/268-schema-lows

Conversation

@wstein

@wstein wstein commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Fixes the three Lows from the #522 review:

  • schematest: a one-shot walk checks every keyword of a schema, not only those a test document reaches.
  • scripts: TestMain removes the docs site the tests built (a -docs-site directory is left alone).
  • schemas: accept what the loader accepts (zero percents, preview ports 0 or 1024..65535, case-insensitive URL scheme). v0-provisional is edited because it is provisional; json-schemas.md now says so.

Refs: #268

Review: Opus CLEAR on 2f7b677; full go test ./... and make check-ci exit 0. Known Low (batched on #399): the schema still accepts first_port 0 with a non-zero last_port and first > last, which the loader rejects. Unverified: the patterns in a real editor.

🤖 Generated with Claude Code

wstein and others added 3 commits October 9, 2026 12:43
validate panicked on an unsupported keyword only when a test document
reached that subschema, so a constraint such as uniqueItems on an unused
property passed unnoticed. Validate and CompareStruct now walk the whole
schema once (properties, items, anyOf, $defs) and panic on any keyword
that is neither supported nor an annotation, and on a schema-valued
additionalProperties, which was silently ignored.

Refs: #268
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
builtSite made a docs-site-* directory with os.MkdirTemp and never
removed it, so every go test run without -docs-site left a built site in
the temporary directory. A TestMain now removes it after the run; a site
given with -docs-site is not touched.

Refs: #268
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The schema flagged configurations that the loader takes: soft_percent 0
and warn_percent 0 (0 means the default), a preview range of 0 and 0
(previews off), and public_url or board.public_url with an uppercase
scheme such as HTTPS:// (url.Parse lowercases it). The percent minimums
are now 0, a preview port is 0 or 1024 to 65535, and the scheme pattern
is case-insensitive in an ECMA-compatible form. Tests run each example
through the schema and the loader, and out-of-range values still fail.

This edits config.v0-provisional.schema.json in place. The never-edit
rule applies to published stable names; v0-provisional is provisional and
nothing relies on it yet. The manual page says so.

Refs: #268
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@wstein

wstein commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Opus review CLEAR on 2f7b677. Full go test ./... and make check-ci exit 0 (author and reviewer). Mutation checks: TestUnsupportedKeywordInUnreachedSubschemaPanics and TestSchemaAcceptsWhatTheLoaderAccepts fail without the fixes. Known Low (batched on #399): schema still accepts first_port 0 with non-zero last_port and first > last. Unverified: patterns in a real editor.

@wstein
wstein marked this pull request as ready for review October 9, 2026 11:07
@wstein
wstein merged commit 3877085 into main Oct 9, 2026
20 of 21 checks passed
@wstein
wstein deleted the fix/268-schema-lows branch October 9, 2026 11:08
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.

1 participant