https://github.com/jtannas/katachi
A tool for describing and validating objects as intuitively as possible.
https://github.com/jtannas/katachi
definitions minitest-assertions rspec ruby schema validation
Last synced: about 2 months ago
JSON representation
A tool for describing and validating objects as intuitively as possible.
- Host: GitHub
- URL: https://github.com/jtannas/katachi
- Owner: jtannas
- License: mit
- Created: 2025-03-03T22:05:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-29T19:11:53.000Z (4 months ago)
- Last Synced: 2026-01-30T07:49:15.272Z (4 months ago)
- Topics: definitions, minitest-assertions, rspec, ruby, schema, validation
- Language: Ruby
- Homepage: https://jtannas.github.io/katachi/
- Size: 589 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

[](https://coveralls.io/github/jtannas/katachi?branch=main)

# Katachi
A tool for describing and validating objects as intuitively as possible.
```ruby
Katachi.compare(
value: {name: 'John', age: 30},
shape: {name: String, age: Integer}
).match? # => true
```
Find out more at [jtannas.github.io/katachi](https://jtannas.github.io/katachi/).
## Installation
Install the gem and add to the application's Gemfile by executing:
```bash
$ bundle add katachi
```
If bundler is not being used to manage dependencies, install the gem by executing:
```bash
$ gem install katachi
```
## Future Features Under Consideration
- [ ] More shapes (e.g. `:$email`, `:$url`, `:$iso_8601`)
- [ ] More "matching modifiers" (e.g. `all_of`, `one_of`, `none_of`)
- [ ] More output formats (e.g. `to_json`, `to_hash`, etc...)
- [ ] Custom shape codes (e.g. `:email_is_invalid`)
- [ ] Rails integration (e.g. `validates_shape_of`)
- [ ] Shape-to-TypeScript conversion
- [ ] Shape-to-Zod conversion
- [ ] Shape-to-OpenAPI conversion
- [ ] `katachi-rspec-api` for testing+documenting APIs in a way inspired by [RSwag](https://github.com/rswag/rswag)
## Development and Contributing
See [CONTRIBUTING.md](./docs/Contributing/Contributing.md) for information on how to contribute to Katachi.
Alternatively, you can check out the [Contributing](https://jtannas.github.io/katachi/docs/Contributing) section on the documentation site.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).