Skip to content

Add type-driven schema generation for 1.6#80

Merged
quinnj merged 2 commits into
masterfrom
codex/agentif-schema-generation
May 26, 2026
Merged

Add type-driven schema generation for 1.6#80
quinnj merged 2 commits into
masterfrom
codex/agentif-schema-generation

Conversation

@quinnj
Copy link
Copy Markdown
Member

@quinnj quinnj commented May 26, 2026

Summary

  • restore JSONSchema 1.6 as an additive release with JSONSchema.schema(::Type) generation while keeping schema unexported
  • keep Schema non-parametric and add JSONSchema.spec(schema), indexing helpers, and JSON serialization support
  • cover Agentif-style tool schemas, nullable unions, nested additionalProperties, tuple variants, and draft 2020-12 tuple output
  • update copyright notices and README language around the generator's draft-v7-compatible subset

Testing

  • JULIA_PKG_PRECOMPILE_AUTO=0 julia --project=. -e 'using Pkg; Pkg.test()'
  • temp-copy LLMProviders tests against the pushed JSONSchema branch
  • JuliaFormatter no-write check via a temporary formatter environment

Co-authored by Codex

@odow
Copy link
Copy Markdown
Collaborator

odow commented May 26, 2026

I'm happy if you're happy

@quinnj
Copy link
Copy Markdown
Member Author

quinnj commented May 26, 2026

Thanks. I've recently been adding "trim compile" test workloads to test suites, so wondering if I should try and do that for JSONSchema as well, but that can be a separate, follow up work. I'm also not sure my downstream packages relying on schema generation will even be trim-compile-able, so mabye not urgent anyway.

@quinnj quinnj merged commit 4076c12 into master May 26, 2026
7 checks passed
@odow
Copy link
Copy Markdown
Collaborator

odow commented May 26, 2026

I'd assume it's not trimmable because of this dispatch:

function _validate_entry(x, schema::AbstractDict, path)
for (k, v) in schema
ret = _validate(x, schema, Val{Symbol(k)}(), v, path)

Rather than some sort of enum-based type-stable but runtime lookup, I dispatch on ::Val.

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.

2 participants