{"id":28171271,"url":"https://github.com/seddryck/schemathief","last_synced_at":"2026-02-26T01:51:40.868Z","repository":{"id":291895950,"uuid":"978272321","full_name":"Seddryck/Schemathief","owner":"Seddryck","description":"Schemathief is a .NET CLI tool that compares a C# class with an existing jsonSchema and forges a clean, standards-compliant JSON Schema delta. It’s ideal for schema evolution tracking, CI pipelines, and making sure your custom additions don’t silently diverge from the spec.","archived":false,"fork":false,"pushed_at":"2025-05-09T07:20:04.000Z","size":3331,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T12:29:38.532Z","etag":null,"topics":["cli-tool","json-schema"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seddryck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-05T18:22:49.000Z","updated_at":"2025-05-09T07:21:35.000Z","dependencies_parsed_at":"2025-05-07T05:14:17.325Z","dependency_job_id":null,"html_url":"https://github.com/Seddryck/Schemathief","commit_stats":null,"previous_names":["seddryck/schemathief"],"tags_count":1,"template":false,"template_full_name":"Seddryck/Template-CSharp","purl":"pkg:github/Seddryck/Schemathief","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FSchemathief","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FSchemathief/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FSchemathief/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FSchemathief/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seddryck","download_url":"https://codeload.github.com/Seddryck/Schemathief/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seddryck%2FSchemathief/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267858734,"owners_count":24155951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-tool","json-schema"],"created_at":"2025-05-15T18:16:48.000Z","updated_at":"2026-02-26T01:51:35.819Z","avatar_url":"https://github.com/Seddryck.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Schemathief\n\n![Logo](https://raw.githubusercontent.com/Seddryck/Schemathief/main/assets/schemathief-logo-256.png)\n\nSchemathief is a lightweight .NET library and CLI tool for generating JSON-Schema delta documents from your CLR types. Whether you need to keep your API schema up-to-date, drive automated data-model documentation, or generate client stubs only for the new fields you’ve added, Schemathief does the heavy lifting:\n\n### Load \u0026 compare\n\n* Fetches a base schema from a URL or file via a pluggable IBaseSchemaLoader\n* Reflects over your target assembly to discover all public, read/write properties\n* Allows you to exclude known fields (e.g. legacy or deprecated properties)\n\n### Generate delta\n\n* Maps .NET types to JSON-Schema types (string, integer, array, object) with full support for nullable, primitive, and complex types\n* Recursively builds nested definitions for child objects and collections\n* Produces a minimal “delta schema” that you can combine with your base via an allOf merge\n\n### CLI \u0026 API\n\n* A dotnet tool–friendly System.CommandLine implementation (delta verb, intuitive options) ready for CI/CD\n* Dependency-injection–friendly services (IDeltaService, IBaseSchemaLoader) so you can stub or replace behavior in your own apps\n* Fully unit‐tested core (SchemaBuilder, TypeInspector, ClrToJsonTypeMapper, TypeInspectorHelper) and integration‐tested end-to-end\n\n### Pack \u0026 ship\n\n* Ship your own JSON-Schema artifacts right inside your NuGet package via contentFiles/any/any/schemas so consumers get editor IntelliSense out of the box\n* Integrates smoothly into existing build pipelines with dotnet pack, GitVersion, or any other automation\n\n# Why Schemathief?\n\n* Zero boilerplate: No more hand-crafting schema diffs by hand or writing reflection glue in every project.\n* Future-proof: Designed around the JSON-Schema draft-07 spec today, easy to extend for draft-next tomorrow.\n* Give it a try in your next microservice or data-model repo—keep your schemas in lock-step with your code\n\n[About][] | [Installing][] | [Quickstart][]\n\n[About]: #about (About)\n[Installing]: #installing (Installing)\n[Quickstart]: #quickstart (Quickstart)\n\n## About\n\n**Social media:** [![website](https://img.shields.io/badge/website-seddryck.github.io/Schemathief-fe762d.svg)](https://seddryck.github.io/Schemathief)\n[![twitter badge](https://img.shields.io/badge/twitter%20Schemathief-@Seddryck-blue.svg?style=flat\u0026logo=twitter)](https://twitter.com/Seddryck)\n\n**Releases:** [![GitHub releases](https://img.shields.io/github/v/release/seddryck/schemathief?label=GitHub%20releases)](https://github.com/seddryck/schemathief/releases/latest) \n[![nuget](https://img.shields.io/nuget/v/Schemathief-cli.svg)](https://www.nuget.org/packages/Schemathief-cli/) [![Docker Image Version](https://img.shields.io/docker/v/seddryck/schemathief?label=docker%20hub\u0026color=0db7ed)](https://hub.docker.com/repository/docker/seddryck/schemathief/) [![GitHub Release Date](https://img.shields.io/github/release-date/seddryck/Schemathief.svg)](https://github.com/Seddryck/Schemathief/releases/latest) [![licence badge](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://github.com/Seddryck/Schemathief/blob/master/LICENSE) \n\n**Dev. activity:** [![GitHub last commit](https://img.shields.io/github/last-commit/Seddryck/Schemathief.svg)](https://github.com/Seddryck/Schemathief/commits)\n![Still maintained](https://img.shields.io/maintenance/yes/2025.svg)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/y/Seddryck/Schemathief)\n\n**Continuous integration builds:** [![Build status](https://ci.appveyor.com/api/projects/status/srnux32j07ysvsp1?svg=true)](https://ci.appveyor.com/project/Seddryck/Schemathief/)\n[![Tests](https://img.shields.io/appveyor/tests/seddryck/Schemathief.svg)](https://ci.appveyor.com/project/Seddryck/Schemathief/build/tests)\n[![CodeFactor](https://www.codefactor.io/repository/github/seddryck/Schemathief/badge)](https://www.codefactor.io/repository/github/seddryck/Schemathief)\n[![codecov](https://codecov.io/github/Seddryck/Schemathief/branch/main/graph/badge.svg?token=76Q2XAL4J7)](https://codecov.io/github/Seddryck/Schemathief)\n\u003c!-- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FSeddryck%2FSchemathief.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FSeddryck%2FSchemathief?ref=badge_shield) --\u003e\n\n**Status:** [![stars badge](https://img.shields.io/github/stars/Seddryck/Schemathief.svg)](https://github.com/Seddryck/Schemathief/stargazers)\n[![Bugs badge](https://img.shields.io/github/issues/Seddryck/Schemathief/bug.svg?color=red\u0026label=Bugs)](https://github.com/Seddryck/Schemathief/issues?utf8=%E2%9C%93\u0026q=is:issue+is:open+label:bug+)\n[![Top language](https://img.shields.io/github/languages/top/seddryck/Schemathief.svg)](https://github.com/Seddryck/Schemathief/search?l=C%23)\n\n## Installing\n\n### Install as a .NET global tool\n\nA .NET global tool is a console application that you can install and run from any directory on your machine. Here’s a guide on how to perform a global installation of a .NET tool:\n\n#### Prerequisites\nBefore installing a .NET global tool, you must have the .NET SDK installed on your machine. You can check if it's installed by running the following command in your terminal or Command Prompt:\n\n```bash\ndotnet --version\n```\nIf .NET is not installed, download it from [Microsoft's official website](https://dotnet.microsoft.com/download/dotnet).\n\n#### Install a .NET Global Tool\nTo install a .NET global tool, you use the dotnet tool install command. This command installs a tool for all users globally on your system.\n\n```bash\ndotnet tool install -g Schemathief-cli\n```\n\n`-g`: This flag tells the dotnet command to install the tool globally.\n\n#### Verify Installation\n\nAfter installing the tool, you can verify that it's available globally by running it from any directory.\n\n```bash\nschemathief --version\n```\n\nThis command will display the installed tool’s version if the installation was successful.\n\n#### Update a .NET Global Tool\n\nTo update a globally installed .NET tool, use the dotnet tool update command:\n\n```bash\ndotnet tool update -g Schemathief-cli\n```\n\n## Quickstart\n\n### `delta` Command – Generate a JSON Schema Delta\n\nGenerates a **delta JSON Schema** from a .NET type by comparing it against a base schema. This is useful when evolving data models incrementally, and you want to isolate new or changed fields.\n\n#### Usage\n\n```bash\nschemathief delta --assembly \u003cpath\u003e --class \u003cfqcn\u003e --base \u003curl\u003e [--exclude \u003ca|b\u003e] [--output \u003cfile\u003e]\n```\n\nYou can also use short options:\n\n```bash\nschemathief delta -a MyLib.dll -c My.Namespace.Type -b https://schemas/base.json -x Id|Timestamp -o delta.json\n```\n\n#### Options\n\n| Option            | Aliases         | Required | Description |\n|-------------------|------------------|----------|-------------|\n| `--assembly`      | `-a`             | ✅ Yes   | Path to the compiled `.dll` file containing the class. |\n| `--class`         | `-c`             | ✅ Yes   | Fully qualified name of the target .NET class (e.g. `MyApp.Models.Customer`). |\n| `--base`          | `-b`             | ✅ Yes   | URL or file path to the base JSON Schema you want to extend. |\n| `--exclude`       | `-x`             | No       | Pipe-separated list of properties to ignore in the delta (e.g. `Id|Timestamp`). |\n| `--output`        | `-o`             | No       | File path to write the generated delta schema. If omitted, output is written to the console. |\n\n#### Examples\n\n##### Output to console:\n\n```bash\nschemathief delta -a bin/Release/MyApi.dll -c MyApi.Models.Person -b https://schemas.example.com/person.base.json\n```\n\n##### Output to file with exclusions:\n\n```bash\nschemathief delta -a MyApi.dll -c MyApi.Models.Invoice -b base-schema.json -x \"CreatedAt|Id\" -o invoice.delta.schema.json\n```\n\n##### Notes\n\n- If the generated delta schema is empty (i.e. all properties are already in the base schema or excluded), the CLI will emit:  \n\n  ```\n  No delta schema generated.\n  ```\n\n- The delta is combined with the base using an `allOf` JSON Schema construct.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseddryck%2Fschemathief","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseddryck%2Fschemathief","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseddryck%2Fschemathief/lists"}