api-versioning

Version Rails APIs with namespaced controllers and Minitest request tests.

3|Updated Oct 16, 2025
One-click install
npx skills add https://github.com/dchuk/source_monitor --skill api-versioning-dchuk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-versioning
Source: https://github.com/dchuk/source_monitor/tree/main/.claude/skills/api-versioning
Command: npx skills add https://github.com/dchuk/source_monitor --skill api-versioning-dchuk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Versioned API design is essential for backward compatibility and predictable client integration. This Skill provides a structured approach to building RESTful APIs with explicit version namespaces, shared error handling, and consistent authentication workflows.

Core Features & Use Cases

  • URL path versioning (e.g., /api/v1) with dedicated controllers for each version
  • Base controllers and shared error handling to reduce duplication
  • API authentication patterns with token scopes and per-version access
  • Testing scaffolds (e.g., Minitest) to verify requests across versions

Quick Start

Configure your Rails app to expose a versioned API namespace and start using v1 controllers.

Frequently Asked Questions about api-versioning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up URL path versioning for a Rails REST API?

URL path versioning for a Rails REST API is configured by exposing version namespaces like /api/v1 with dedicated controllers. This maintains backward compatibility by isolating changes to specific version namespaces while sharing behavior through base controllers.

What is the best way to maintain backward compatibility when updating a Rails API?

The best way to maintain backward compatibility when updating a Rails API is using explicit version namespaces. This isolates breaking changes to new versions while keeping existing endpoints predictable for integrated clients.

How do I share error handling and authentication across multiple API versions in Rails?

You share error handling and authentication across multiple API versions in Rails by implementing base controllers. These base controllers centralize shared behavior, reducing duplication across your versioned API namespaces.

Can I use Minitest to verify requests across different API versions?

Yes, you can use Minitest to verify requests across different API versions. The approach provides testing scaffolds that validate consistent request routing, error handling, and authentication workflows for each versioned namespace.

How does token authentication work with per-version access in a versioned Rails API?

Token authentication with per-version access in a versioned Rails API works by applying token scopes to specific version namespaces. This restricts client access to only the authorized API versions they are scoped to use.