Apipie/apipie-rails
54.1
Adequate · 19 September 2026
5.6k
lines of production code
Ruby
with JavaScript
1
measurement over time
What this system is
Apipie-rails is a Ruby gem that provides a DSL for documenting Rails APIs, generating interactive HTML documentation and Swagger/OpenAPI definitions. It captures API metadata, parameters, and responses through an extractor that records examples from functional tests and live requests. The system supports API versioning, deprecation tracking, and automatic response validation via RSpec helpers to ensure documentation accuracy.
How it got here
2011 — Apipie-rails rebranding and Rails 7.1 upgrade
14 changes.
The project was rebranded from restapi to apipie-rails, introducing native Swagger/OpenAPI support and removing the legacy documentation engine. This period also involved upgrading the runtime dependency to Rails 7.1, modernizing the codebase with RuboCop standards, and expanding the test suite to cover the new DSL and configuration options.
2012 — Initial Apipie framework release
13 changes.
This period marks the initial release of the Apipie gem, introducing a DSL-based framework for documenting Rails APIs with features like versioning, Swagger export, and interactive HTML views. The work included building core extraction and recording components, enhancing documentation views with deprecation tracking and localization, and establishing release engineering tooling.
2013–2026 — Swagger generator refactoring and test expansion
22 changes.
This period focused on refactoring the Swagger generation logic into modular service classes and introducing a new warning system for better configuration and error reporting. Significant effort was also dedicated to expanding test coverage across core components, extractors, and the new generator architecture, alongside adding features like an install generator and RSpec response validation helpers.
Features
Add ApipieHelper for generating API documentation headings
A new ApipieHelper module has been introduced to support the rendering of API documentation. This helper includes the ActionView TagHelper and provides a \heading\ method that generates HTML heading tags (h1 through h6) based on the provided title and level, facilitating consistent formatting for API resource, method, error, and parameter descriptions.
app/helpers · high confidence
Added release engineering tooling for apipie-rails
Added a new release notebook (gem\_release.ipynb) to automate the release process for the apipie-rails gem, including version updates, changelog generation, and testing steps. Also added tito configuration (tito.props) and package metadata (packages/rubygem-apipie-rails) to support automated tagging and building of the gem at version 0.0.7-1.
rel-eng · high confidence
Initial release of Apipie API documentation framework
This change introduces the Apipie gem, a new tool for documenting Rails APIs. It provides a DSL for defining API resources, methods, parameters, and responses, which are then rendered into interactive HTML documentation. The framework supports API versioning, parameter validation, Swagger/OpenAPI JSON export, and automatic example recording. It integrates with Rails via a Railtie to extract route information and includes middleware for serving static assets and adding checksums to responses.
lib/apipie · high confidence
New API documentation extractor with example recording and multipart support
This change introduces the core components for the Apipie documentation extractor, including the Collector, Recorder, and Writer classes. The Recorder now supports analyzing request environments and functional tests, with specific handling for multipart/form-data uploads (reformatting them for documentation) and converting uploaded file parameters to strings to avoid encoding errors. The Writer handles persisting these recorded examples to JSON files, supporting optional compression and merging old and new examples while preserving user-edited titles and 'show in doc' settings. The Collector manages the aggregation of API descriptions and parameter refinements based on recorded calls.
lib/apipie/extractor · high confidence
New ApipiesController with authentication, authorization, and Swagger support
The API documentation interface now includes a new controller that supports configurable authentication and authorization, allowing users to restrict access to documentation resources and methods. It adds support for generating Swagger JSON output, handles localized documentation via language parameters, and improves security by sanitizing cache paths against directory traversal attacks. The controller also respects custom layout configurations and script name environments for proper URL routing.
app/controllers · high confidence
New RSpec helper for automatic API response validation
A new \response\_validation\_helper.rb\ file has been added to the RSpec integration, enabling users to automatically validate API responses against Apipie's documented schemas. This helper provides two modes: a manual RSpec matcher (\match\_declared\_responses\) for explicit checks, and an auto-validation mode (\auto\_validate\_rendered\_views\) that intercepts controller test requests to ensure returned JSON matches the \returns\ declarations in the API documentation, failing the test if mismatches occur.
lib/apipie/rspec · high confidence
New Rake tasks for static documentation, Swagger, and caching
The \lib/tasks/apipie.rake\ file introduces several new command-line tasks for managing API documentation. Users can now generate static HTML documentation via \apipie:static\, produce static JSON documentation with \apipie:static\_json\, and export Swagger/OpenAPI definitions using \apipie:static\_swagger\_json\. A new \apipie:did\_swagger\_change\ task allows comparing current Swagger output against previous references to detect changes. Additionally, the \apipie:cache\ task has been expanded to support generating partial caches (index or resources only) and handles versioning and localization more robustly. These tasks rely on a new \renderer\ helper that prioritizes application-level views over built-in defaults.
lib/tasks · high confidence
New install generator with configurable API and documentation paths
Apipie-rails now provides an \apipie:install\ generator that sets up the initial configuration and routes. Users can customize the documentation URL (defaulting to \/apipie\) and the API request base path (defaulting to \/api\) via command-line options, which are applied to the generated initializer. A separate \apipie:views\ generator is also introduced to allow copying Apipie's default views into the application for customization.
lib/generators · high confidence
Removals
Removal of core REST API documentation engine components
The \lib/restapi\ directory has been completely removed, deleting the core files that powered the library's API documentation generation and DSL. This includes the \Api\, \ApiManager\, and \Application\ classes responsible for tracking API definitions and parameters, as well as the \DSL\ module that provided methods like \api\, \param\, and \error\ for describing endpoints. Consequently, the ability to automatically document Rails controllers and methods via this specific DSL is no longer available in this location.
lib/restapi · high confidence
Behavioural changes
Enhanced API documentation with deprecation tracking, custom metadata, and cross-references
This update introduces several improvements to how API documentation is structured and displayed. Users can now mark specific parameters as deprecated using the new \ParamDescription::Deprecation\ class, which supports detailed sunset and deprecation versioning. The error description system has been refactored to support custom metadata (via the \meta\ option) and improved translation handling, while also recognizing Rack symbols as HTTP status codes for more flexible error definitions. Additionally, the \see\ DSL method now supports multiple references to other API methods, enabling better cross-linking within the documentation, and a new \ReferencedDefinitions\ singleton ensures consistent schema handling in Swagger generation.
apipie-rails · high confidence
Expose base URL on API routes for documentation
Apipie now attaches a base\_url accessor to ActionDispatch::Journey::Route objects. This allows the documentation engine to access and display the specific base URL path associated with each API endpoint, ensuring that generated documentation accurately reflects the route's mounting context.
_lib/apipie/core\ext · high confidence
Library renamed from restapi to apipie-rails with expanded Swagger support
The library has been renamed from \restapi\ to \apipie-rails\, removing the legacy \lib/restapi.rb\ entry point and introducing a comprehensive \lib/apipie-rails.rb\ that loads the new module structure. This change includes significant architectural updates to support Swagger/OpenAPI generation, such as moving API schema logic into \Apipie::Generator::Swagger\ and introducing services like \Apipie::MethodDescription::ApisService\ to handle API descriptions and route integration. Users will now interact with the \apipie\ namespace, which provides enhanced DSL capabilities for documenting API methods, parameters, and responses with native Swagger output support.
lib · high confidence
New fluid layout for API documentation with Disqus and localization support
The API documentation view now uses a new fluid layout template that includes a viewport meta tag for responsive design, localized page titles, and optional integration of Disqus for discussions. The layout also loads HTML5 shim scripts for older IE versions and renders footer content via yield blocks, providing a more modern and customizable structure for the documentation interface.
app/views/layouts · high confidence
Redesigned API documentation views with enhanced metadata and deprecation support
The Apipie documentation views have been completely rewritten to support richer API descriptions and better organization. Key changes include the addition of a dedicated deprecation display (showing deprecated\_in, sunset\_at, and info) for resources, methods, and parameters, as well as the ability to hide specific parameters from documentation using a 'show' flag. The views now render custom response headers, error metadata, and localized language/version selectors. A new Disqus integration allows for community comments on documentation pages, and a checksum endpoint provides a hash of the API documentation for caching purposes. Additionally, the 404 error page now distinguishes between missing resources and missing methods, and the overall layout supports clean URLs via configurable link extensions.
app/views/apipie · high confidence
Standardize RuboCop configuration and update project metadata
The project now uses a structured \.rubocop.yml\ configuration file that inherits from \.rubocop\_todo.yml\, explicitly enabling plugins for Rails, RSpec, and Performance, and setting the target Ruby version to 2.6. This replaces the previous ad-hoc or missing configuration, providing consistent code style enforcement across the codebase. Additionally, the project license file (\MIT-LICENSE\) has been updated with the correct copyright year and author, and the legacy \.autotest\ file has been removed.
(repo-wide) · high confidence
Swagger generator refactored into modular service classes with new configuration and warning system
The Swagger generation logic in \lib/apipie/generator\ has been restructured into a set of dedicated service classes (e.g., \ApiSchemaService\, \ParametersService\, \ResponseService\) and composites, replacing the previous monolithic approach. This change introduces a new configuration interface under \Apipie::Generator::Swagger::Config\ with attributes like \skip\_default\_tags\, \json\_input\_uses\_refs\, and \suppress\warnings\, while maintaining backward compatibility by deprecating the old \swagger\\*\ configuration methods. A new warning system (\Warning\, \WarningWriter\) has been added to track and report issues such as missing summaries or undefined path parameters, and a \ComputedInterfaceId\ singleton is now available to generate a deterministic ID for regression testing. Additionally, the generator now supports custom headers in responses and allows overriding the \operationId\ per route.
lib/apipie/generator · high confidence
Test coverage
Added API v1 controller specs for architectures and base configuration; Added API v2 controller specs for Apipie integration; Added comprehensive test coverage for Apipie core components; Added dummy API v2 controllers for testing inheritance and versioning; Added test coverage for the Apipie extractor components; Added test coverage for the Swagger generator subsystem; Added test engine component for API documentation validation; Added test fixtures for nested API controllers; Added test for TestEngine::MemesController mounted path; Added test support utilities for Rake tasks and custom validators; Added tests for API v2 sub-controller resource description inheritance; Added tests for API versioning in ArchitecturesController; Added tests for Apipie method description and param deprecation; Added tests for Apipie routing mapper extensions; Added tests for ArrayValidator; Added tests for Swagger generation and validation; Added tests for Swagger method description services; Added tests for Swagger param description generation components; Added tests for nested API v2 resources controller; Added tests for static file and cache generation rake tasks; Cleaned up dummy test logs and added .gitkeep for SQLite; Expanded controller test coverage for concerns, extensions, and response validation; Expanded dummy application controllers for comprehensive API documentation testing; Removed legacy JavaScript libraries from dummy app; Test coverage for custom Apipie layout integration; Updated dummy app configuration for testing; Updated dummy app environment configurations for Rails 5 compatibility; Updated dummy app initializer configuration and Rails security setup; Updated path resolution in dummy app configuration files; Updated test infrastructure and added custom RSpec matchers.
Dependencies
Added dedicated Gemfile for IDE tooling
A new Gemfile.tools file has been introduced to manage dependencies specifically for IDE integrations, such as VS Code. This file includes rubocop-rails, rubocop-rspec, rubocop-performance, and ruby-lsp (\~\> 0.5.1), allowing development tools to function correctly without cluttering the main application's Gemfile.
gemfiles · high confidence
Updated bundled JavaScript libraries (jQuery and Bootstrap)
The bundled client-side JavaScript libraries have been upgraded: jQuery is updated to version 1.12.4 (replacing the previous 1.11.3) and Bootstrap is updated to version 2.3.2. These changes include the new bundled source files for jQuery and Bootstrap components (such as collapse and transition modules) which are now available in the public assets directory.
app/public · high confidence
Upgrade to Rails 7.1 and modernize gem dependencies
The gem now requires Rails 7.1 (via actionpack and activesupport) as its runtime dependency, dropping support for older Rails versions. The Gemfile has been updated to use the gemspec for dependency resolution and explicitly includes development dependencies like rspec-rails, rails-controller-testing, and net-smtp (for Ruby 3.1+). The legacy Gemfile.lock and the old restapi.gemspec have been removed, and a new apipie-rails.gemspec defines the project with a minimum Ruby version of 2.6.0.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 54.
Lenses
- Code Health 95
- Architecture 97
- Maturity 54
- Readiness 65
- Security 87
- Accessibility 39
Changes since last survey
- 300 commits — 239 feature/other, 61 fixes
By area
- (root) — 103 commits
- lib/apipie — 98 commits
- (repo) — 25 commits
- spec/lib — 20 commits
- .github/workflows — 15 commits
- spec/dummy — 10 commits
- config/locales — 5 commits
- app/controllers — 3 commits
- app/views — 3 commits
- lib/tasks — 3 commits
- spec/controllers — 3 commits
- spec/spec_helper.rb — 3 commits
- app/public — 2 commits
- gemfiles/Gemfile.rails60 — 2 commits
- .vscode/settings.json — 1 commit
- gemfiles/Gemfile.rails42 — 1 commit
- gemfiles/Gemfile.rails42.lock — 1 commit
- rel-eng/gem_release.ipynb — 1 commit
- spec/test_engine — 1 commit
Notable commits
- fix: Add configuration option to revert from 0.7.0 breaking change
- fix: Fix #446 Fixing full_description translation (#808)
- fix: Fix 'Method foo.en not found for resource bar' errors with no languages set
- fix: Fix ActiveSupport::Deprecation.warn deprecation
- fix: Fix CI: Get the build green for modern ruby and rack and rubocop-rspec (#939)
- fix: Fix Lint/NonDeterministicRequireOrder error (#827)
- fix: Fix RSpec/FilePath violations (#825)
- fix: Fix Ruby 2.7 keyword arguments deprecation warnings
- fix: Fix authorization of resources (#655)
- fix: Fix cache rendering with namespaced resources (#874)
- fix: Fix deprecated content_type on Rails >= 6 (#879)
- fix: Fix depreciated File.exists. (#721)
- fix: Fix error climbing controller hierarchy (#875)
- fix: Fix error for hash object warnings with delegated method descriptions (#938)
- fix: Fix example recording for behaviour-like defined tests
- fix: Fix intermittent swagger test failures
- fix: Fix issue where scope is nil when a param_group is accessed nested within response (#774)
- fix: Fix issue with loading Rails logger in tests
- fix: Fix param: Consider default_value: nil as valid config (#894)
- fix: Fix readme code block (#765)
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Apipie/apipie-rails was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 5d1d7ef302ce986eb5b26770e2a9408ec579c304 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.