Make breaking API changes without breaking things! Use request_migrations to craft backwards-compatible migrations for API requests, responses, and mo

keygen-sh/request_migrations

submited by
Style Pass
2022-06-23 22:00:05

Make breaking API changes without breaking things! Use request_migrations to craft backwards-compatible migrations for API requests, responses, and more. This gem was extracted from Keygen and is being used in production to serve millions of API requests per day.

request_migrations supports Ruby 3. We encourage you to upgrade if you're on an older version. Ruby 3 provides a lot of great features, like better pattern matching.

Use request_migrations to make backwards-incompatible changes in your code, while providing a backwards-compatible interface for clients on older API versions. What exactly does that mean? Well, let's demonstrate!

After awhile, we realize our User model's combined name attribute is not working too well, and we want to change it to first_name and last_name.

But what about the API consumers who were relying on name? We just broke our API contract with them! To resolve this, let's create our first request migration.

Leave a Comment