Skip to content

Apply string validation to AbstractString inputs - #98

Merged
quinnj merged 1 commit into
masterfrom
maintenance/jsonschema-string-instances
Oct 4, 2026
Merged

quinnj merged 1 commit into
masterfrom
maintenance/jsonschema-string-instances

Conversation

@quinnj

@quinnj quinnj commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

SubString and LazyString values were rejected by type="string", while length and pattern assertions without a type restriction silently accepted them. The schema generator already declares these types as strings.

Use AbstractString for the instance checks in type, maxLength, minLength, and pattern. This applies the existing string rules together and preserves the current Unicode codepoint length and regular-expression behavior.

Validation:

  • All 68 public controls pass on Julia 1.9.4 and 1.13.1; the prior tree passes 44 and fails 24 on both versions.
  • Full package suites pass 5,867 assertions on both versions, with bounds checks.
  • Controls cover String/SubString/LazyString, generated schemas, empty and nullable values, Unicode length, anchored/unanchored patterns, nested error locations, and keyword applicability to other instance types.
  • JuliaFormatter 2.14.0, git diff --check, and an independent private review pass. All seven hosted checks pass at 30fdff54f45432494b7da5907d234da33ea2706a. All six native coverage uploads were accepted for the correct repository/head and finished processing; aggregate coverage is 96.46%. The ordinary squash merge is df66dffa04f3f299c6e69fcc41c18639a3659238, with the same tested tree. All seven main-branch checks pass; all six main coverage uploads were accepted and processed at 96.46%.

Co-authored by Codex

AI disclosure: This work was prepared with assistance from OpenAI Codex.

Use the existing string rules for slices and lazy strings, including type, length, pattern and nested error locations.

AI disclosure: This work was prepared with assistance from OpenAI Codex.
@quinnj
quinnj merged commit df66dff into master Oct 4, 2026
7 checks passed
@quinnj

quinnj commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Merged as df66dffa04f3f299c6e69fcc41c18639a3659238. Its tree matches the reviewed and tested PR head. All seven checks pass on both the PR and main; all six coverage uploads for each commit were accepted for JuliaIO/JSONSchema.jl and finished processing at 96.46%.

The 68 public controls and both full 5,867-assertion suites pass on Julia 1.9.4 and 1.13.1. This fixes type checking and length/pattern enforcement together for AbstractString values, including SubString and LazyString.

AI disclosure: This work was prepared with assistance from OpenAI Codex.

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