Project

explicit

0.0
The project is in a healthy, maintained state
Explicit is a validation and documentation library for REST APIs that enforces documented types at runtime
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 7.2.1
 Project Readme

Explicit

Explicit is an opinionated set of libraries to extend Rails. It favors explicit, data-driven definitions over convention and reflection: you declare what your app expects, and Explicit enforces it at runtime, documents it and tests it.

Documentation example screenshot
Click here to visit the example documentation page

Installation

Add the following line to your Gemfile and then run bundle install:

gem "explicit", "~> 0.2"

Features

  • Requests and documentation — Define the params, headers and responses of your API endpoints next to your controllers. Requests are validated at runtime against the documented types, documentation is published as a web page straight from the definitions — along with an OpenAPI/Swagger schema and an MCP server — and your tests verify that responses match the docs.

  • Types — Types are the foundation of request validation, and they can also be used on their own. A type is a data literal describing the shape of a value; it validates the input at runtime and coerces it into the expected Ruby object, returning a result tagged array.

  • Property based testing (todo) — Type definitions double as generators: produce arbitrary valid — and invalid — inputs from the declared types and run your endpoints against hundreds of generated cases instead of a handful of hand-picked examples.

  • Mutation testing (todo) — Mutate the code under test and re-run the test suite to check the mutation gets caught. A surviving mutant points to behavior your tests don't actually verify.

  • Simulation testing (todo) — Run long, randomized sequences of requests against your app in a controlled, reproducible simulation to surface bugs that only appear from the interaction of many operations over time.

  • Generators/factories (todo) — Generate valid example data and test factories directly from type definitions, so fixtures never drift from what the API actually accepts.