Goal
Decide and implement the final output contract for Draft 2020-12 JSON Schema documents.
Today to_json_schema returns a RubyLLM/provider-oriented envelope:
{
name: "PersonSchema",
description: "...",
schema: {
type: "object",
properties: { ... }
}
}
A pure Draft 2020-12 JSON Schema document would look like:
{
"$schema" => "https://json-schema.org/draft/2020-12/schema",
"title" => "PersonSchema",
"description" => "...",
"type" => "object",
"properties" => { ... }
}
Decisions to make
- Should
to_json_schema become the pure JSON Schema output?
- Should we add a temporary migration method first, such as
to_json_schema_document?
- Should the current RubyLLM envelope remain available under another method until the next major release?
- Should the current
name concept map to JSON Schema title?
- When do we remove provider-only keys such as
strict from this gem?
Acceptance criteria
- Pure output validates against the Draft 2020-12 meta-schema.
- Output uses JSON-compatible string keys.
- Provider-only keys are not included in the pure schema document.
- README documents the migration path.
- RubyLLM compatibility expectations are clear before release.
Goal
Decide and implement the final output contract for Draft 2020-12 JSON Schema documents.
Today
to_json_schemareturns a RubyLLM/provider-oriented envelope:A pure Draft 2020-12 JSON Schema document would look like:
Decisions to make
to_json_schemabecome the pure JSON Schema output?to_json_schema_document?nameconcept map to JSON Schematitle?strictfrom this gem?Acceptance criteria