{"id":13879372,"url":"https://github.com/72pulses/apidoco","last_synced_at":"2025-10-07T06:23:34.325Z","repository":{"id":10214790,"uuid":"64592043","full_name":"72pulses/apidoco","owner":"72pulses","description":"Ruby on Rails API documentation tool ","archived":false,"fork":false,"pushed_at":"2023-03-08T19:44:39.000Z","size":1637,"stargazers_count":72,"open_issues_count":14,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T05:08:53.086Z","etag":null,"topics":["api-documentation-tool","rails","rails-engine","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"https://apidoco-demo.herokuapp.com/docs/apis/v2","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/72pulses.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","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":"2016-07-31T12:08:09.000Z","updated_at":"2024-02-21T04:15:11.000Z","dependencies_parsed_at":"2024-11-24T08:31:35.578Z","dependency_job_id":"fdf5f1e6-f710-46c5-84f8-622115465686","html_url":"https://github.com/72pulses/apidoco","commit_stats":{"total_commits":101,"total_committers":10,"mean_commits":10.1,"dds":0.4554455445544554,"last_synced_commit":"d0cd74fc0a61f5dddc83c1a51dd9506c38171eb2"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/72pulses%2Fapidoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/72pulses%2Fapidoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/72pulses%2Fapidoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/72pulses%2Fapidoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/72pulses","download_url":"https://codeload.github.com/72pulses/apidoco/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"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":["api-documentation-tool","rails","rails-engine","ruby","ruby-gem"],"created_at":"2024-08-06T08:02:18.812Z","updated_at":"2025-10-07T06:23:29.273Z","avatar_url":"https://github.com/72pulses.png","language":"Ruby","readme":"[![Gem Version](https://badge.fury.io/rb/apidoco.svg)](https://badge.fury.io/rb/apidoco)\n\n# Apidoco - Ruby on Rails API documentation tool\nEasy documentation of REST APIs - [Demo](http://demo.apidoco.com/docs/).\n\n## Screenshots\n\n![screeshot 1](https://github.com/72pulses/apidoco/blob/master/images/1.png?raw=true)\n\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'apidoco'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nAdd this line to your routes:\n\n```ruby\nmount Apidoco::Engine, at: \"/docs\"\n```\n\n## Configuring\n\nCreate a configuration file in initializers e.g. /config/initializers/apidoco.rb and add the following.\n\n```ruby\nApidoco.auth_name = 'authentication_name'\nApidoco.auth_password = 'authentication_password'\nApidoco.app_name = 'your app name'\nApidoco.base_path =\n```\n### # Basic Http Authentication\n - To add basic http authentication add the `auth_name` and `auth_password` to the config file.\n```\nApidoco.auth_name = 'authentication_name'\nApidoco.auth_password = 'authentication_password'\n```\n\n### # `app_name`\n - The `app_name` will be added to the sidebar\n```\nApidoco.app_name = 'Apidoco Demo'\n```\n\n### # `base_path`\n - Sets the root folder for the documentation\n - Default: `docs/api`\n```\nApidoco.base_path = 'documentations'\n```\n\n## Generators\n\nTo create a Api documentation file for an action:\n\n```ruby\nrails g apidoco resource\n```\nFor Example:\n```\nrails g apidoco v1/posts\n```\nwill create the following files by default with sample content\n- docs/api/v1/posts/show.json\n- docs/api/v1/posts/create.json\n- docs/api/v1/posts/update.json\n- docs/api/v1/posts/destroy.json\n- docs/api/v1/posts/index.json\n\nThe root path will be based on the `base_path` config.\n\nIf you need to create Api documention file for actions other than default\ncrud actions, you need to specify the actions for which the files need to be generated\n\n```ruby\nrails g apidoco v1/posts download upload\n```\nwill create the following files with sample content\n- docs/api/v1/posts/download.json\n- docs/api/v1/posts/upload.json\n\n### Sample API documentation format\n\n```\n// docs/api/v1/posts/create.json\n{\n  \"published\": true,\n\n  \"name\": \"Create\",\n\n  \"sort_order\": 1,\n\n  \"end_point\": \"api/v1/posts/:id.json\",\n\n  \"http_method\": \"POST\",\n\n  \"params\": [\n    {\n      \"key\": \"post[title]\",\n      \"required\": true,\n      \"type\": \"String\",\n      \"description\": \"Title of the post\",\n      \"validations\": [\"Should be less than or equal to 40 characters\"]\n    },\n    {\n      \"key\": \"post[content]\",\n      \"required\": true,\n      \"type\": \"String\",\n      \"description\": \"Content/Body of the post\",\n      \"validations\": [\"Should be less than or equal to 300 characters\"]\n    },\n    {\n      \"key\": \"post[publsihed]\",\n      \"required\": true,\n      \"type\": \"Boolean\",\n      \"description\": \"Published status of the post\"\n    }\n  ],\n\n  \"header\": {\n    \"Authentication\": \"Token token=\u003ctoken\u003e\",\n    \"Content-Type\": \"application/json\"\n  },\n\n  \"response_properties\": [\n    {\n      \"key\": \"success\",\n      \"type\": \"Boolean\"\n    }, {\n      \"key\": \"message\",\n      \"type\": \"String\",\n      \"description\": \"It can be any generic message. Examples:- Successfully created, Missing properties - title, content\"\n    }\n  ],\n\n  \"examples\": [\n    {\n      \"request_headers\": {\n        \"Authentication\": \"Token token=\u003ctoken\u003e\",\n        \"Content-Type\": \"application/json\"\n      },\n\n      \"request\": {\n        \"post\": {\n          \"title\": \"Ruby is awesome\",\n          \"content\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec interdum a tellus sed finibus.\",\n          \"published\": false\n        }\n      },\n\n      \"response_headers\": {\n        \"Authentication\": \"Token token=\u003ctoken\u003e\"\n      },\n\n      \"response\": {\n        \"suceess\": true,\n        \"message\": \"Successfully created\"\n      }\n    }\n  ]\n}\n```\n\n```\n//docs/api/v1/posts/delete.json\n{\n  \"published\": true,\n\n  \"name\": \"Destroy Post\",\n\n  \"sort_order\": 6,\n\n  \"end_point\": \"api/v1/posts/:id.json\",\n\n  \"http_method\": \"DELETE\",\n\n  \"header\": {\n    \"Authentication\": \"Token token=\u003ctoken\u003e\",\n    \"Content-Type\": \"application/json\"\n  },\n\n  \"response_properties\": [\n    {\n      \"key\": \"success\",\n      \"type\": \"Boolean\"\n    }, {\n      \"key\": \"message\",\n      \"type\": \"String\",\n      \"description\": \"It can be any generic message. Examples:- Successfully created, Missing properties - title, content\"\n    }\n  ],\n\n  \"examples\": [\n    {\n      \"request_headers\": {\n        \"Authentication\": \"Token token=\u003ctoken\u003e\",\n        \"Content-Type\": \"application/json\"\n      },\n\n      \"response\": {\n        \"suceess\": true,\n        \"message\": \"Successfully destroyed\"\n      }\n    }\n  ]\n}\n```\n\n## Documentation format reference\n\n### # published\n - Set this to false if you do not want to list this api\n - Optional\n - Default: true\n\n### # name\n - Name of the api\n - Required\n\n### # sort_order\n - Order of the api to be listed\n - Optional\n\n ### # end_point\n  - Required\n  - Usage:\n```\n\"end_point\": \"/posts\"\n```\n\n### # http_method\n - The HTTP method of the API\n - Required\n - Usage:\n ```\n \"http_method\": \"GET\"\n ```\n\n ### # params\n  - Parameters to be used\n  - Optional\n  - Usage:\n```\n\"params\": [\n  {\n    \"key\": \"post['name']\",\n\n    \"required\": true,\n\n    \"type\": \"String\",\n\n    \"notes\": [\"Name or title of the post\"],\n\n    \"validations\": [\"should be less than or equal to 150 characters\"]\n  }\n]\n```\n\n### # header\n - headers to be used\n - Optional\n - Usage:\n ```\n \"header\": {\n   \"Authorization\": \"Token token=\u003ctoken\u003e\",\n   \"Content-type\": 'application/json'\n  }\n```\n\n### # response_properties\n - Describing the properties in the response body\n - Optional\n - Usage:\n ```\n\"response_properties\": [\n    {\n      \"key\": \"success\",\n      \"type\": \"Boolean\"\n    }, {\n      \"key\": \"message\",\n      \"type\": \"String\",\n      \"description\": \"It can be any generic message. Examples:- Successfully created.\"\n    }\n  ],\n ```\n\n### # examples\n - Array of sample requests, responses and their headers\n - Optional\n - Usage:\n```\n\"examples\": [\n  {\n    \"request_headers\": {\n      \"Authorization\": \"Token token=\u003ctoken\u003e\",\n      \"Content-type\": 'application/json'\n    },\n\n    \"request\": {\n      \"post\": {\n        \"name\": \"I was scared\"\n      }\n    },\n\n    \"response_headers\": {\n      \"Content-type\": 'application/json'\n    },\n\n    \"response\": {\n      \"message\": \"Post was successfully created\",\n      \"id\": 101\n    }\n  }\n]\n```\n\n## License\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F72pulses%2Fapidoco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F72pulses%2Fapidoco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F72pulses%2Fapidoco/lists"}