Skip to content

Decide Draft 2020-12 output contract #32

Description

@crmne

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions