ruby-grape/grape-swagger
61.8
Adequate · 6 November 2026
2.1k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Features
Added example API with spline management and file upload endpoints
The example/api directory now includes a Grape-based API implementation featuring CRUD operations for 'splines' (resources with x, y, and reticulated attributes) and a file upload endpoint. The API uses grape-entity for structured JSON responses and defines specific HTTP status codes and documentation for each route.
example/api · high confidence
New Rake tasks for fetching and validating OpenAPI documentation
A new \OapiTasks\ class is introduced in \lib/grape-swagger/rake/oapi\_tasks.rb\, providing two Rake tasks under the \oapi\ namespace: \oapi:fetch\ and \oapi:validate\. The \fetch\ task generates OpenAPI documentation by making requests to the API routes, optionally saving the output to a JSON file. The \validate\ task invokes \fetch\ to generate the documentation and then uses the \swagger-cli\ to validate the resulting file, ensuring the API documentation is correct. The task initializer now accepts either an API class instance or a string representing the class name, which is then constantized.
lib/grape-swagger/rake · high confidence
Updated example app with Postman collection and Rack configuration
The example application now includes a new \config.ru\ file that configures the Rack environment, sets up CORS headers, mounts the API endpoints, and integrates the Swagger documentation. Additionally, a Postman collection file (\example\_requests.postman\_collection\) has been added, providing pre-configured requests for testing the API endpoints such as creating, reading, updating, and deleting splines.
example · high confidence
Architecture
Refactored documentation generation into modular classes
The internal logic for generating Swagger documentation has been reorganized from a monolithic structure into distinct, single-responsibility classes within the \lib/grape-swagger/doc\_methods\ directory. This refactoring introduces dedicated modules for handling specific aspects of the documentation: \BuildModelDefinition\ manages schema construction and discriminator support, \DataType\ standardizes type mapping and collection formats, \Extensions\ handles custom \x-\ extension injection, \MoveParams\ processes body parameter definitions, \ParseParams\ handles individual parameter parsing, and \PathString\ manages route path formatting. This change improves code maintainability and separation of concerns without altering the external API or user-facing documentation output.
_lib/grape-swagger/doc\methods · high confidence
Behavioural changes
Refactor grape-swagger into GrapeSwagger namespace with deprecation aliases
The library has been reorganized to reside within the \GrapeSwagger\ module, moving internal components like \SwaggerRouting\ and \SwaggerDocumentationAdder\ into this namespace. To maintain backward compatibility, top-level aliases are provided for existing code, but these are now marked as deprecated constants. This change ensures cleaner namespace isolation while preventing immediate breakage for downstream applications relying on the previous global constant names.
lib · high confidence
grape-swagger 2.3.0: major refactor and Grape 3.2+ compatibility
This release refactors the internal architecture of grape-swagger to improve maintainability and add support for Grape 3.2+. The documentation generation logic has been modularized into a dedicated \DocMethods\ module, and request parameter parsing is now handled by a pluggable \RequestParamParserRegistry\ with separate parsers for headers, route, and body parameters. These changes enable better handling of Grape 3.2+ features, such as variant types in path parameters, and provide a more robust foundation for future extensions.
lib/grape-swagger · high confidence
Test coverage
Added comprehensive test coverage for Swagger v2 documentation generation; Added comprehensive test coverage for core documentation generation components; Added test coverage for Swagger documentation edge cases; Added test fixtures for model parsers; Added test support infrastructure for GrapeSwagger; Initial test infrastructure and version verification; Removed legacy test infrastructure and placeholder tests.
Dependencies
Updates dependencies and raises minimum Ruby version to 3.1
The gemspec now requires Ruby 3.1 or higher and allows Grape versions from 2.1 up to (but not including) 5.0. The Gemfile has been modernized to use the gemspec for core dependencies and introduces conditional logic to support testing against various Grape versions, including the latest development head. Development and test dependencies have been updated to include Rack 3+ for Grape 2.0+, RuboCop 1.50, RSpec 3.9, and specific gems like \cgi\ and \ostruct\ for newer Ruby versions, while pinning \json\ below 3.0 for Ruby versions older than 3.2 to ensure compatibility.
(dependencies) · high confidence
Housekeeping
Introduces RuboCop configuration and RSpec settings
The project now includes a \.rubocop.yml\ file to enforce Ruby style guidelines (targeting Ruby 3.4) and a \.rspec\ file to standardize test execution with color, profiling, and documentation formatting. These files establish the development environment for code quality and testing consistency.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 62 (+1.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 63 → 63 (+0.0)
- Architecture 98 → 98 (+0.0)
- Maturity 52 → 57 (+5.6)
- Readiness 67 → 67 (-0.3)
- Security 74 → 61 (-12.5)
Resolved (6)
- Ambiguous naming: primitive? and request_primitive? are semantically similar but distinct. It is unclear if primitive? is a superset of request_primitive? or if they check different contexts (e.g., schema vs. HTTP request). The naming convention is inconsistent (? suffix for boolean, but one has a domain qualifier and the other doesn't).
- Inconsistent insertion semantics: register implies appending or simple registration, while insert_before and insert_after imply ordered list manipulation. The API surface mixes a simple 'add' pattern with explicit 'ordered insertion' patterns without a unified insert or add_at method.
- Off-boarding risk: anonymized user #1
- Orphaned file (lib/grape-swagger/doc_methods/parse_params.rb)
- Same ambiguity as above: primitives vs request_primitives. The relationship between these two sets is not obvious from the names.
- Same inconsistency as ModelParsers: register vs insert_before/after creates ambiguity about whether register is the default ordered insertion or an unordered append.
New (2)
- Floating git dependency: grape-swagger-entity
- Off-boarding risk: anonymized user #1
Changes since last survey
- 5 commits — 5 feature/other, 0 fixes
By area
- (root) — 4 commits
- lib/grape-swagger — 1 commit
Notable commits
- change: Bump Danger comment workflow from 0.1.0 to 0.1.1 (#1009)
- change: Bump Danger run workflow from 0.1.0 to 0.1.1 (#1008)
- change: Hide nested params of a hidden Hash parameter (#1016)
- change: Pin git below 6 so Danger loads in CI (#1012)
- change: Preserve length limits in body parameter definitions and map them by type (#1011)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ruby-grape/grape-swagger 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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit d2d6d4d2037a10703adf6dd8a48c5fe8ac5b8331 — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.