{"id":15487909,"url":"https://github.com/dblock/grape-on-rack-v1-inside-v2","last_synced_at":"2025-09-20T05:32:58.689Z","repository":{"id":9607848,"uuid":"11531252","full_name":"dblock/grape-on-rack-v1-inside-v2","owner":"dblock","description":"Demonstrate versioning fallback in Grape.","archived":false,"fork":false,"pushed_at":"2024-02-29T00:37:07.000Z","size":14,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-28T21:05:43.995Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dblock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-19T15:45:21.000Z","updated_at":"2022-06-08T01:35:58.000Z","dependencies_parsed_at":"2024-10-08T23:10:28.376Z","dependency_job_id":"3c9bc442-270f-41d2-a8b5-6c4860aabbaa","html_url":"https://github.com/dblock/grape-on-rack-v1-inside-v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fgrape-on-rack-v1-inside-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fgrape-on-rack-v1-inside-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fgrape-on-rack-v1-inside-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dblock%2Fgrape-on-rack-v1-inside-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dblock","download_url":"https://codeload.github.com/dblock/grape-on-rack-v1-inside-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233566907,"owners_count":18695286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T06:43:55.825Z","updated_at":"2025-09-20T05:32:53.420Z","avatar_url":"https://github.com/dblock.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Grape API w/ Versioning Fallback\n================================\n\n[![Build Status](https://secure.travis-ci.org/dblock/grape-on-rack-v1-inside-v2.png)](http://travis-ci.org/dblock/grape-on-rack-v1-inside-v2)\n\nA [Grape](http://github.com/intridea/grape) API mounted on Rack with two versions where `v2` builds incrementally on top of `v1`. In this example the `only_in_v1` method is only implemented on version `v1`, the root method is implemented on both versions, etc.\n\nRun\n---\n\n```\n$ bundle install\n$ rackup\n```\n\nTry\n---\n\n```\n# without a version\n\ncurl http://localhost:9292/\n{\"version\":\"v2\"}\n\ncurl http://localhost:9292/only_in_v1\n{\"only_in_v1\":\"true\"}\n\ncurl http://localhost:9292/in_both_v1_and_v2\n{\"in_both_v1_and_v2\":\"v2\"}\n\n# version v2 (current)\n\nImplemented in v2.\n\ncurl http://localhost:9292 -H \"Accept:application/vnd.acme-v2+json\"\n{\"version\":\"v2\"}\n\nImplemented in v1 and inherited by v2.\n\ncurl http://localhost:9292/only_in_v1 -H \"Accept:application/vnd.acme-v2+json\"\n{\"only_in_v1\":\"true\"}\n\nImplemented in v2.\n\ncurl http://localhost:9292/only_in_v2 -H \"Accept:application/vnd.acme-v2+json\"\n{\"only_in_v2\":\"true\"}\n\ncurl http://localhost:9292/in_both_v1_and_v2 -H \"Accept:application/vnd.acme-v2+json\"\n{\"in_both_v1_and_v2\":\"v2\"}\n\n# version v1 (old)\n\ncurl http://localhost:9292 -H \"Accept:application/vnd.acme-v1+json\"\n{\"version\":\"v1\"}\n\ncurl http://localhost:9292/only_in_v1 -H \"Accept:application/vnd.acme-v1+json\"\n{\"only_in_v1\":\"true\"}\n\ncurl http://localhost:9292/in_both_v1_and_v2 -H \"Accept:application/vnd.acme-v1+json\"\n{\"in_both_v1_and_v2\":\"v1\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fgrape-on-rack-v1-inside-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdblock%2Fgrape-on-rack-v1-inside-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdblock%2Fgrape-on-rack-v1-inside-v2/lists"}