{"id":16072991,"url":"https://github.com/d4be4st/api-swagger-test","last_synced_at":"2026-06-12T13:31:07.703Z","repository":{"id":151101281,"uuid":"11748056","full_name":"d4be4st/api-swagger-test","owner":"d4be4st","description":"Testing the swagger and grape api for rails","archived":false,"fork":false,"pushed_at":"2014-02-28T15:05:06.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T02:23:04.019Z","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/d4be4st.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}},"created_at":"2013-07-29T19:37:30.000Z","updated_at":"2018-09-11T08:05:55.000Z","dependencies_parsed_at":"2023-05-21T17:00:41.067Z","dependency_job_id":null,"html_url":"https://github.com/d4be4st/api-swagger-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d4be4st/api-swagger-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4be4st%2Fapi-swagger-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4be4st%2Fapi-swagger-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4be4st%2Fapi-swagger-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4be4st%2Fapi-swagger-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d4be4st","download_url":"https://codeload.github.com/d4be4st/api-swagger-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d4be4st%2Fapi-swagger-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34247460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09T08:01:56.322Z","updated_at":"2026-06-12T13:31:07.688Z","avatar_url":"https://github.com/d4be4st.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Relevant repositories\n\n* [grape](https://github.com/intridea/grape)\n* [swagger-ui](https://github.com/wordnik/swagger-ui)\n* [grape-entity](https://github.com/intridea/grape-entity)\n* [grape-swagger](https://github.com/tim-vandecasteele/grape-swagger)\n* [swagger-ui_rails](https://github.com/d4be4st/swagger-ui_rails)\n\n## Preparing application\n\nAdd to your Gemfile:\n\n    gem 'grape', '0.6.1'\n    gem 'grape-entity', '0.3.0'\n    gem 'grape-swagger', '0.7.6', :github =\u003e 'd4be4st/grape-swagger'\n    gem 'swagger-ui_rails', '0.1.7'\n\n## Adding swagger-ui\n\nadd to application.css and application.js\n\n    require swagger-ui\n\ncreate a api_docs view with:\n\n    = render 'swagger_ui/swagger_ui', discovery_url: '/path/to/swagger_doc'\n\nadd route to routes.rb\n\n    get 'api/docs' =\u003e 'api_docs#index'\n\n## Create Grape API\n\nplease read [grape documentation](https://github.com/intridea/grape)\n\n### Example\n\n    module API\n\n      class Users \u003c Grape::API\n\n        desc 'Get all users'\n        get :users do\n          users = User.all\n        end\n\n        desc 'Get one user'\n        get 'users/:id' do\n          User.find(params[:id])\n        end\n\n        desc 'Create user'\n        params do\n          group :user do\n            requires :username, type: String\n            requires :email, type: String\n            optional :password, type: String\n          end\n        end\n        post :user do\n          User.create(params[:user])\n        end\n      end\n\n    end\n\n## Create Grape Swagger Documenatation\n\nplease read [grape-swagger documentation](https://github.com/tim-vandecasteele/grape-swagger)\n\n### Example\n\n    module API\n\n      class Root \u003c Grape::API\n\n        prefix 'api'\n        version 'v1'\n        format :json\n\n        mount API::Users\n        add_swagger_documentation api_version: 'v1', hide_documentation_path: true, hide_format: true\n      end\n\n    end\n\n## Add Api to Routes\n\n    mount API::Root =\u003e '/'\n\nBecause of the prefix and the version, api urls are:\n\n    GET /api/v1/swagger_doc\n    GET /api/v1/users\n    GET /api/v1/users/:id\n    POST /api/v1/user\n\n## RESTful Model Representations\n\nUse [grape-entities](https://github.com/intridea/grape#restful-model-representations)\n\n### Example\n\n    module API\n\n      class UserEntity \u003c Grape::Entity\n        expose :email\n        expose :username\n      end\n\n      class Users \u003c Grape::API\n\n        desc 'Get all users'\n        get :users do\n          users = User.all\n          present users, with: Users::Entity\n        end\n      end\n    end\n\n## Try it!\n\n1. Clone this repository\n2. run bundle\n3. start server\n4. open localhost:3000/api/docs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4be4st%2Fapi-swagger-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd4be4st%2Fapi-swagger-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd4be4st%2Fapi-swagger-test/lists"}