<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh" -->

---
title: RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for...
description: RubyLLM::Schema has been extracted and renamed to Schematist, a standalone JSON Schema DSL for Ruby with full Draft 2020-12 coverage. The key breaking change...
canonical: https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for Ruby with Full Draft 2020-12 Coverage | daily.dev
og:description: RubyLLM::Schema has been extracted and renamed to Schematist, a standalone JSON Schema DSL for Ruby with full Draft 2020-12 coverage. The key breaking change...
og:url: https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh
og:image: https://api.daily.dev/og/posts/SOvN9O2hH.png
og:image:alt: RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for Ruby with Full Draft 2020-12 Coverage
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for Ruby with Full Draft 2020-12 Coverage

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 6 min read · 2 upvotes · 0 comments

## Summary

RubyLLM::Schema has been extracted and renamed to Schematist, a standalone JSON Schema DSL for Ruby with full Draft 2020-12 coverage. The key breaking change is that `to_json_schema` now returns a proper JSON Schema document (with string keys and `$schema` declared) instead of OpenAI's `response_format` envelope. New features include full composition keywords (`allOf`, `oneOf`, `not`), `unevaluatedProperties`, tuple support via `prefixItems`, `contains` with bounds, encoded content schemas, core keywords like `$dynamicAnchor`/`$dynamicRef`, and proc-based values resolved at render time for dynamic schemas. The gem has zero runtime dependencies. A compatibility shim (`ruby_llm-schema` 1.0.0) aliases old constants with deprecation warnings during migration. RubyLLM 2.0 will depend on Schematist.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://paolino.me/schematist>

## Questions this post answers

### How do I migrate from ruby_llm-schema to schematist in Ruby?

Replace the gem 'ruby_llm-schema' dependency with gem 'schematist', rename schema classes from RubyLLM::Schema to Schematist::Schema, and update error handling from RubyLLM::Schema::ValidationError to Schematist::ValidationError. RubyLLM::Helpers becomes Schematist::Helpers. A final ruby_llm-schema 1.0.0 release depends on Schematist and aliases old constants so RubyLLM::Schema keeps resolving, but it warns on load and is the last release under that name.

_daily.dev helps developers track gem renames and breaking changes like this before they hit production._

### Why did to_json_schema in RubyLLM::Schema change its output format?

The old to_json_schema returned an OpenAI response_format envelope with keys like name, description, schema, and strict, requiring every non-OpenAI consumer to dig out the actual schema from a nested symbol key. The new Schematist gem's to_json_schema returns the raw Draft 2020-12 JSON Schema document directly, with string keys and a $schema declaration, and drops the OpenAI-specific strict flag entirely since it isn't a JSON Schema keyword.

_following breaking API changes like this on daily.dev saves time when upgrading structured-output integrations._

### What JSON Schema Draft 2020-12 keywords does the Schematist Ruby gem support?

Schematist supports the full Draft 2020-12 vocabulary: allOf, oneOf, and not alongside anyOf for composition; unevaluatedProperties for cross-branch validation; propertyNames and patternProperties for object keys; uniqueItems, prefixItems, and contains with bounds for arrays; content_encoding and content_media_type for encoded strings; and core keywords like $id, $anchor, $comment, $dynamicAnchor, $dynamicRef, and $vocabulary passed through as-is.

_developers comparing JSON Schema tooling coverage can follow library updates like Schematist's on daily.dev._

## Similar posts on daily.dev

- [JSON schema cache, herb:check, and more\!](https://daily.dev/posts/json-schema-cache-herb-check-and-more--1fdsyvquu) · This Week in Rails · 0 upvotes · 0 comments
- [RubyLLM 2.0: Providers, Protocols, and Provider Gems](https://daily.dev/posts/rubyllm-2-0-providers-protocols-and-provider-gems-hvesmpsrq) · RUBYLAND · 2 upvotes · 0 comments
- [luismoyano/shiny-json-logic-ruby: A JSONLogic runtime for Ruby that actually works](https://daily.dev/posts/luismoyano-shiny-json-logic-ruby-a-jsonlogic-runtime-for-ruby-that-actually-works-pfuiz5kq3) · Ruby Flow · 0 upvotes · 0 comments
- [Why JSON Schema matters more than ever in the age of generative AI](https://daily.dev/posts/why-json-schema-matters-more-than-ever-in-the-age-of-generative-ai-xskn2gm03) · The New Stack · 1 upvotes · 0 comments
- [Schema-Enforced JSON Access, Postgres Type Decoding, and more](https://daily.dev/posts/schema-enforced-json-access-postgres-type-decoding-and-more-imamm5zrx) · Rails · 0 upvotes · 0 comments

---

Tags: [#ruby](https://daily.dev/tags/ruby), [#rails](https://daily.dev/tags/rails)

[View this post on daily.dev](https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for Ruby with Full Draft 2020-12 Coverage","url":"https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh"},"datePublished":"2026-08-11T12:58:35.207Z","dateModified":"2026-09-13T20:08:36.216Z","description":"RubyLLM::Schema has been extracted and renamed to Schematist, a standalone JSON Schema DSL for Ruby with full Draft 2020-12 coverage. The key breaking change...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d684bba6c93c48bedb128aced4441134?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d684bba6c93c48bedb128aced4441134?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ruby,rails","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for Ruby with Full Draft 2020-12 Coverage"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/rubyllm-schema-is-now-schematist-a-json-schema-dsl-for-ruby-with-full-draft-2020-12-coverage-sovn9o2hh#faq","mainEntity":[{"@type":"Question","name":"How do I migrate from ruby_llm-schema to schematist in Ruby?","acceptedAnswer":{"@type":"Answer","text":"Replace the gem 'ruby_llm-schema' dependency with gem 'schematist', rename schema classes from RubyLLM::Schema to Schematist::Schema, and update error handling from RubyLLM::Schema::ValidationError to Schematist::ValidationError. RubyLLM::Helpers becomes Schematist::Helpers. A final ruby_llm-schema 1.0.0 release depends on Schematist and aliases old constants so RubyLLM::Schema keeps resolving, but it warns on load and is the last release under that name. daily.dev helps developers track gem renames and breaking changes like this before they hit production."}},{"@type":"Question","name":"Why did to_json_schema in RubyLLM::Schema change its output format?","acceptedAnswer":{"@type":"Answer","text":"The old to_json_schema returned an OpenAI response_format envelope with keys like name, description, schema, and strict, requiring every non-OpenAI consumer to dig out the actual schema from a nested symbol key. The new Schematist gem's to_json_schema returns the raw Draft 2020-12 JSON Schema document directly, with string keys and a $schema declaration, and drops the OpenAI-specific strict flag entirely since it isn't a JSON Schema keyword. following breaking API changes like this on daily.dev saves time when upgrading structured-output integrations."}},{"@type":"Question","name":"What JSON Schema Draft 2020-12 keywords does the Schematist Ruby gem support?","acceptedAnswer":{"@type":"Answer","text":"Schematist supports the full Draft 2020-12 vocabulary: allOf, oneOf, and not alongside anyOf for composition; unevaluatedProperties for cross-branch validation; propertyNames and patternProperties for object keys; uniqueItems, prefixItems, and contains with bounds for arrays; content_encoding and content_media_type for encoded strings; and core keywords like $id, $anchor, $comment, $dynamicAnchor, $dynamicRef, and $vocabulary passed through as-is. developers comparing JSON Schema tooling coverage can follow library updates like Schematist's on daily.dev."}}]}
```

