{"id":13495139,"url":"https://github.com/richhollis/swagger-docs","last_synced_at":"2025-03-28T16:31:38.860Z","repository":{"id":11344346,"uuid":"13773189","full_name":"richhollis/swagger-docs","owner":"richhollis","description":"Generates swagger-ui json files for Rails APIs with a simple DSL.","archived":false,"fork":false,"pushed_at":"2017-11-03T08:52:04.000Z","size":254,"stargazers_count":749,"open_issues_count":36,"forks_count":150,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-01T13:51:24.058Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richhollis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-22T12:56:36.000Z","updated_at":"2024-09-28T23:05:23.000Z","dependencies_parsed_at":"2022-07-07T16:57:33.175Z","dependency_job_id":null,"html_url":"https://github.com/richhollis/swagger-docs","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richhollis%2Fswagger-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richhollis%2Fswagger-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richhollis%2Fswagger-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richhollis%2Fswagger-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richhollis","download_url":"https://codeload.github.com/richhollis/swagger-docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222395709,"owners_count":16977610,"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-07-31T19:01:31.524Z","updated_at":"2024-10-31T10:30:33.519Z","avatar_url":"https://github.com/richhollis.png","language":"Ruby","funding_links":[],"categories":["Documentation","Ruby"],"sub_categories":[],"readme":"# Swagger::Docs\n\nGenerates swagger-ui json files for rails apps with APIs. You add the swagger DSL to your controller classes and then run one rake task to generate the json files.\n\n[![Gem Version](https://badge.fury.io/rb/swagger-docs.svg)][gem]\n[![Dependency Status](https://gemnasium.com/richhollis/swagger-docs.svg?travis)][gemnasium]\n\n[gem]: https://rubygems.org/gems/swagger-docs\n[travis]: http://travis-ci.org/richhollis/swagger-docs\n[gemnasium]: https://gemnasium.com/richhollis/swagger-docs\n[coveralls]: https://coveralls.io/r/richhollis/swagger-docs\n\n## Swagger Version Specification Support\n\nThis project supports elements of the v1.2 swagger specification. It *does not* support the v2 specification. If you are looking for support for the newer specification the please see the [swagger-blocks](https://github.com/fotinakis/swagger-blocks/) project. I don't currently have any plans to add support for v2.0 at this time due to time constraints, but I'm open to accepting a PR on  this. Contact me if you are interested in helping with that effort - thanks!\n\n## Example usage\n\nHere is an extract of the DSL from a user controller API class:\n\n```ruby\nswagger_controller :users, \"User Management\"\n\nswagger_api :index do\n  summary \"Fetches all User items\"\n  notes \"This lists all the active users\"\n  param :query, :page, :integer, :optional, \"Page number\"\n  response :unauthorized\n  response :not_acceptable\n  response :requested_range_not_satisfiable\nend\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'swagger-docs'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install swagger-docs\n\n## Usage\n\n### Create Initializer\n\nCreate an initializer in config/initializers (e.g. swagger_docs.rb) and define your APIs:\n\n```ruby\nSwagger::Docs::Config.register_apis({\n  \"1.0\" =\u003e {\n    # the extension used for the API\n    :api_extension_type =\u003e :json,\n    # the output location where your .json files are written to\n    :api_file_path =\u003e \"public/api/v1/\",\n    # the URL base path to your API\n    :base_path =\u003e \"http://api.somedomain.com\",\n    # if you want to delete all .json files at each generation\n    :clean_directory =\u003e false,\n    # Ability to setup base controller for each api version. Api::V1::SomeController for example.\n    :parent_controller =\u003e Api::V1::SomeController,\n    # add custom attributes to api-docs\n    :attributes =\u003e {\n      :info =\u003e {\n        \"title\" =\u003e \"Swagger Sample App\",\n        \"description\" =\u003e \"This is a sample description.\",\n        \"termsOfServiceUrl\" =\u003e \"http://helloreverb.com/terms/\",\n        \"contact\" =\u003e \"apiteam@wordnik.com\",\n        \"license\" =\u003e \"Apache 2.0\",\n        \"licenseUrl\" =\u003e \"http://www.apache.org/licenses/LICENSE-2.0.html\"\n      }\n    }\n  }\n})\n```\n\n#### Configuration options\n\nThe following table shows all the current configuration options and their defaults. The default will be used if you don't supply your own value.\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eOption\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003cth\u003eDefault\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003eapi_extension_type\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eThe extension, if necessary, used for your API - e.g. :json or :xml \u003c/td\u003e\n\u003ctd\u003enil\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003eapi_file_path\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eThe output file path where generated swagger-docs files are written to. \u003c/td\u003e\n\u003ctd\u003epublic/\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003ebase_path\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eThe URI base path for your API - e.g. api.somedomain.com\u003c/td\u003e\n\u003ctd\u003e/\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003ebase_api_controller / base_api_controllers\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eThe base controller class your project uses; it or its subclasses will be where you call swagger_controller and swagger_api. An array of base controller classes may be provided.\u003c/td\u003e\n\u003ctd\u003eActionController::Base\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003eclean_directory\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eWhen generating swagger-docs files this option specifies if the api_file_path should be cleaned first. This means that all files will be deleted in the output directory first before any files are generated.\u003c/td\u003e\n\u003ctd\u003efalse\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003eformatting\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eSpecifies which formatting method to apply to the JSON that is written. Available options: :none, :pretty\u003c/td\u003e\n\u003ctd\u003e:pretty\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003ecamelize_model_properties\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eCamelizes property names of models. For example, a property name called first_name would be converted to firstName.\u003c/td\u003e\n\u003ctd\u003etrue\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\u003cb\u003eparent_controller\u003c/b\u003e\u003c/td\u003e\n\u003ctd\u003eAssign a different controller to use for the configuration\u003c/td\u003e\n\u003ctd\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\n### Documenting a controller\n\n```ruby\nclass Api::V1::UsersController \u003c ApplicationController\n\n  swagger_controller :users, \"User Management\"\n\n  swagger_api :index do\n    summary \"Fetches all User items\"\n    notes \"This lists all the active users\"\n    param :query, :page, :integer, :optional, \"Page number\"\n    param :path, :nested_id, :integer, :optional, \"Team Id\"\n    response :unauthorized\n    response :not_acceptable, \"The request you made is not acceptable\"\n    response :requested_range_not_satisfiable\n  end\n\n  swagger_api :show do\n    summary \"Fetches a single User item\"\n    param :path, :id, :integer, :optional, \"User Id\"\n    response :ok, \"Success\", :User\n    response :unauthorized\n    response :not_acceptable\n    response :not_found\n  end\n\n  swagger_api :create do\n    summary \"Creates a new User\"\n    param :form, :first_name, :string, :required, \"First name\"\n    param :form, :last_name, :string, :required, \"Last name\"\n    param :form, :email, :string, :required, \"Email address\"\n    param_list :form, :role, :string, :required, \"Role\", [ \"admin\", \"superadmin\", \"user\" ]\n    response :unauthorized\n    response :not_acceptable\n  end\n\n  swagger_api :update do\n    summary \"Updates an existing User\"\n    param :path, :id, :integer, :required, \"User Id\"\n    param :form, :first_name, :string, :optional, \"First name\"\n    param :form, :last_name, :string, :optional, \"Last name\"\n    param :form, :email, :string, :optional, \"Email address\"\n    param :form, :tag, :Tag, :required, \"Tag object\"\n    response :unauthorized\n    response :not_found\n    response :not_acceptable\n  end\n\n  swagger_api :destroy do\n    summary \"Deletes an existing User item\"\n    param :path, :id, :integer, :optional, \"User Id\"\n    response :unauthorized\n    response :not_found\n  end\n\n  # Support for Swagger complex types:\n  # https://github.com/wordnik/swagger-core/wiki/Datatypes#wiki-complex-types\n  swagger_model :Tag do\n    description \"A Tag object.\"\n    property :id, :integer, :required, \"User Id\"\n    property :name, :string, :optional, \"Name\"\n    property_list :type, :string, :optional, \"Tag Type\", [\"info\", \"warning\", \"error\"]\n  end\nend\n```\n\n#### Support for Enums (PR #108)\n\n```\nproperty_list :type, :string, :optional, \"Type\", [\"info\", \"warning\", \"error\"]\n```\n\n#### Custom resource paths`(PR #126)\n\n```ruby\nclass Api::V1::UsersController \u003c ApplicationController\n\n  swagger_controller :users, \"User Management\", resource_path: \"/some/where\"\n```\n\n### DRYing up common documentation\n\nSuppose you have a header or a parameter that must be present on several controllers and methods. Instead of duplicating it on all the controllers you can do this on your API base controller:\n\n```ruby\nclass Api::BaseController \u003c ActionController::Base\n  class \u003c\u003c self\n    Swagger::Docs::Generator::set_real_methods\n\n    def inherited(subclass)\n      super\n      subclass.class_eval do\n        setup_basic_api_documentation\n      end\n    end\n\n    private\n    def setup_basic_api_documentation\n      [:index, :show, :create, :update, :delete].each do |api_action|\n        swagger_api api_action do\n          param :header, 'Authentication-Token', :string, :required, 'Authentication token'\n        end\n      end\n    end\n  end\nend\n```\n\nAnd then use it as a superclass to all you API controllers. All the subclassed controllers will have the same documentation applied to them.\n\n#### Alternate method\n\nUsing a block for the swagger_api definition:\n\n```ruby\nclass Api::V1::UserController \u003c Api::V1::BaseController\n\n  swagger_controller :user, \"Users\"\n\n  def self.add_common_params(api)\n    api.param :form, \"user[first_name]\", :string, :optional, \"Notes\"\n    api.param :form, \"user[last_name]\", :string, :optional, \"Name\"\n    api.param :form, \"user[email]\", :string, :optional, \"Email\"\n  end\n\n  swagger_api :create do |api|\n    summary \"Create a new User item\"\n    Api::V1::UserController::add_common_params(api)\n    response :unauthorized\n    response :not_acceptable\n    response :unprocessable_entity\n  end\n  \n  swagger_api :update do |api|\n    summary \"Update an existing User item\"\n    Api::V1::UserController::add_common_params(api)\n    response :unauthorized\n    response :not_acceptable\n    response :unprocessable_entity\n  end\nend\n```\n\n### DSL Methods\n\n\u003ctable\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eMethod\u003c/th\u003e\n\u003cth\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\n\u003ctr\u003e\n\u003ctd\u003esummary\u003c/td\u003e\n\u003ctd\u003eThe summary of the API\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003enotes (optional)\u003c/td\u003e\n\u003ctd\u003eThe associated notes for the API\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003eparam\u003c/td\u003e\n\u003ctd\u003eStandard API Parameter\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003eparam_list\u003c/td\u003e\n\u003ctd\u003eStandard API Enum/List parameter.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003eresponse\u003c/td\u003e\n\u003ctd\u003eTakes a symbol or status code and passes it to `Rack::Utils.status_code`. The current list of status codes can be seen here: https://github.com/rack/rack/blob/master/lib/rack/utils.rb. An optional message can be added.\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n### Run rake task to generate docs\n\n```\nrake swagger:docs\n```\n\nSwagger-ui JSON files should now be present in your api_file_path (e.g. ./public/api/v1)\n\n#### Additional logging for generation failures\n\nErrors aren't displayed by default. To see all error messages use the ```SD_LOG_LEVEL``` environment variable when running the rake task:\n\n```\nSD_LOG_LEVEL=1 rake swagger:docs\n```\n\nCurrently only constantize errors are shown.\n\nErrors are written to ```$stderr```. Error logging methods can be found in ```Config``` and can be overridden for custom behaviour.\n\nThanks to **[@tomtt](https://github.com/tomtt/)** who originally suggested this idea in #81\n\n### Sample\n\nA sample Rails application where you can run the above rake command and view the output in swagger-ui can be found here:\n\nhttps://github.com/richhollis/swagger-docs-sample\n\n![Screen shot 1](https://github.com/richhollis/swagger-docs-sample/raw/master/swagger-docs-screenshot-2.png)\n\n\n### Advanced Customization\n\n#### Inheriting from a custom Api controller\n\nBy default swagger-docs is applied to controllers inheriting from ApplicationController.\nIf this is not the case for your application, use this snippet in your initializer\n_before_ calling Swagger::Docs::Config#register_apis(...).\n\n```ruby\nclass Swagger::Docs::Config\n  def self.base_api_controller; Api::ApiController end\nend\n```\n\n#### Custom route discovery for supporting Rails Engines\n\nBy default, swagger-docs finds controllers by traversing routes in `Rails.application`.\nTo override this, you can customize the `base_application` config in an initializer:\n\n```ruby\nclass Swagger::Docs::Config\n  def self.base_application; Api::Engine end\nend\n```\n\nIf you want swagger to find controllers in `Rails.application` and/or multiple\nengines you can override `base_application` to return an array. \n\n```ruby\nclass Swagger::Docs::Config\n  def self.base_application; [Rails.application, Api::Engine, SomeOther::Engine] end\nend\n```\n\nOr, if you prefer you can override `base_applications` for this purpose. The plural\n`base_applications` takes precedence over `base_application` and MUST return an\narray.\n\n```ruby\nclass Swagger::Docs::Config\n  def self.base_applications; [Rails.application, Api::Engine, SomeOther::Engine] end\nend\n```\n\n#### Transforming the `path` variable\n\nSwagger allows a distinction between the API documentation server and the hosted API\nserver through the `path` variable (see [Swagger: No server Integrations](https://github.com/wordnik/swagger-core/wiki/No-server-Integrations)). To override the default swagger-docs behavior, you can provide a `transform_path`\nclass method in your initializer:\n\n```ruby\nclass Swagger::Docs::Config\n  def self.transform_path(path, api_version)\n    \"http://example.com/api-docs/#{api_version}/#{path}\"\n  end\nend\n```\n\nThe transformation will be applied to all API `path` values in the generated `api-docs.json` file.\n\n#### Precompile\n\nIt is best-practice *not* to keep documentation in version control. An easy way\nto integrate swagger-docs into a conventional deployment setup (e.g. capistrano,\nchef, or opsworks) is to piggyback on the 'assets:precompile' rake task. And don't forget\nto add your api documentation directory to .gitignore in this case.\n\n```ruby\n#Rakefile or lib/task/precompile_overrides.rake\nnamespace :assets do\n  task :precompile do\n    Rake::Task['assets:precompile'].invoke\n    Rake::Task['swagger:docs'].invoke\n  end\nend\n```\n\n### Output files\n\napi-docs.json output:\n\n\n```json\n{\n  \"apiVersion\": \"1.0\",\n  \"swaggerVersion\": \"1.2\",\n  \"basePath\": \"/api/v1\",\n  \"apis\": [\n    {\n      \"path\": \"/users.{format}\",\n      \"description\": \"User Management\"\n    }\n  ]\n}\n```\n\nusers.json output:\n\n```json\n{\n  \"apiVersion\": \"1.0\",\n  \"swaggerVersion\": \"1.2\",\n  \"basePath\": \"http://api.somedomain.com/api/v1/\",\n  \"resourcePath\": \"/users\",\n  \"apis\": [\n    {\n      \"path\": \"/users\",\n      \"operations\": [\n        {\n          \"summary\": \"Fetches all User items\",\n          \"parameters\": [\n            {\n              \"paramType\": \"query\",\n              \"name\": \"page\",\n              \"type\": \"integer\",\n              \"description\": \"Page number\",\n              \"required\": false\n            }\n          ],\n          \"responseMessages\": [\n            {\n              \"code\": 401,\n              \"message\": \"Unauthorized\"\n            },\n            {\n              \"code\": 406,\n              \"message\": \"The request you made is not acceptable\"\n            },\n            {\n              \"code\": 416,\n              \"message\": \"Requested Range Not Satisfiable\"\n            }\n          ],\n          \"method\": \"get\",\n          \"nickname\": \"Api::V1::Users#index\"\n        }\n      ]\n    },\n    {\n      \"path\": \"nested/{nested_id}/sample\",\n      \"operations\": [\n        {\n          \"summary\": \"Fetches all User items\",\n          \"parameters\": [\n            {\n              \"paramType\": \"query\",\n              \"name\": \"page\",\n              \"type\": \"integer\",\n              \"description\": \"Page number\",\n              \"required\": false\n            },\n            {\n              \"paramType\": \"path\",\n              \"name\": \"nested_id\",\n              \"type\": \"integer\",\n              \"description\": \"Team Id\",\n              \"required\": false\n            }\n          ],\n          \"responseMessages\": [\n            {\n              \"code\": 401,\n              \"message\": \"Unauthorized\"\n            },\n            {\n              \"code\": 406,\n              \"message\": \"The request you made is not acceptable\"\n            },\n            {\n              \"code\": 416,\n              \"message\": \"Requested Range Not Satisfiable\"\n            }\n          ],\n          \"method\": \"get\",\n          \"nickname\": \"Api::V1::Users#index\"\n        }\n      ]\n    },\n    {\n      \"path\": \"/users\",\n      \"operations\": [\n        {\n          \"summary\": \"Creates a new User\",\n          \"parameters\": [\n            {\n              \"paramType\": \"form\",\n              \"name\": \"first_name\",\n              \"type\": \"string\",\n              \"description\": \"First name\",\n              \"required\": true\n            },\n            {\n              \"paramType\": \"form\",\n              \"name\": \"last_name\",\n              \"type\": \"string\",\n              \"description\": \"Last name\",\n              \"required\": true\n            },\n            {\n              \"paramType\": \"form\",\n              \"name\": \"email\",\n              \"type\": \"string\",\n              \"description\": \"Email address\",\n              \"required\": true\n            }\n          ],\n          \"responseMessages\": [\n            {\n              \"code\": 401,\n              \"message\": \"Unauthorized\"\n            },\n            {\n              \"code\": 406,\n              \"message\": \"Not Acceptable\"\n            }\n          ],\n          \"method\": \"post\",\n          \"nickname\": \"Api::V1::Users#create\"\n        }\n      ]\n    },\n    {\n      \"path\": \"/users/{id}\",\n      \"operations\": [\n        {\n          \"summary\": \"Fetches a single User item\",\n          \"parameters\": [\n            {\n              \"paramType\": \"path\",\n              \"name\": \"id\",\n              \"type\": \"integer\",\n              \"description\": \"User Id\",\n              \"required\": false\n            }\n          ],\n          \"responseMessages\": [\n            {\n              \"code\": 401,\n              \"message\": \"Unauthorized\"\n            },\n            {\n              \"code\": 404,\n              \"message\": \"Not Found\"\n            },\n            {\n              \"code\": 406,\n              \"message\": \"Not Acceptable\"\n            }\n          ],\n          \"method\": \"get\",\n          \"nickname\": \"Api::V1::Users#show\"\n        }\n      ]\n    },\n    {\n      \"path\": \"/users/{id}\",\n      \"operations\": [\n        {\n          \"summary\": \"Updates an existing User\",\n          \"parameters\": [\n            {\n              \"paramType\": \"path\",\n              \"name\": \"id\",\n              \"type\": \"integer\",\n              \"description\": \"User Id\",\n              \"required\": true\n            },\n            {\n              \"paramType\": \"form\",\n              \"name\": \"first_name\",\n              \"type\": \"string\",\n              \"description\": \"First name\",\n              \"required\": false\n            },\n            {\n              \"paramType\": \"form\",\n              \"name\": \"last_name\",\n              \"type\": \"string\",\n              \"description\": \"Last name\",\n              \"required\": false\n            },\n            {\n              \"paramType\": \"form\",\n              \"name\": \"email\",\n              \"type\": \"string\",\n              \"description\": \"Email address\",\n              \"required\": false\n            },\n            {\n              \"paramType\": \"form\",\n              \"name\": \"tag\",\n              \"type\": \"Tag\",\n              \"description\": \"Tag object\",\n              \"required\": true\n            }\n          ],\n          \"responseMessages\": [\n            {\n              \"code\": 401,\n              \"message\": \"Unauthorized\"\n            },\n            {\n              \"code\": 404,\n              \"message\": \"Not Found\"\n            },\n            {\n              \"code\": 406,\n              \"message\": \"Not Acceptable\"\n            }\n          ],\n          \"method\": \"put\",\n          \"nickname\": \"Api::V1::Users#update\"\n        }\n      ]\n    },\n    {\n      \"path\": \"/users/{id}\",\n      \"operations\": [\n        {\n          \"summary\": \"Deletes an existing User item\",\n          \"parameters\": [\n            {\n              \"paramType\": \"path\",\n              \"name\": \"id\",\n              \"type\": \"integer\",\n              \"description\": \"User Id\",\n              \"required\": false\n            }\n          ],\n          \"responseMessages\": [\n            {\n              \"code\": 401,\n              \"message\": \"Unauthorized\"\n            },\n            {\n              \"code\": 404,\n              \"message\": \"Not Found\"\n            }\n          ],\n          \"method\": \"delete\",\n          \"nickname\": \"Api::V1::Users#destroy\"\n        }\n      ]\n    }\n  ],\n  \"models\": {\n    \"Tag\": {\n      \"id\": \"Tag\",\n      \"required\": [\n        \"id\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"description\": \"User Id\"\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"Name\",\n          \"foo\": \"test\"\n        }\n      },\n      \"description\": \"A Tag object.\"\n    }\n  }\n}\n```\n\n## Thanks to our contributors\n\nThanks to jdar, fotinakis, stevschmid, ldnunes, aaronrenner and all of our contributors for making swagger-docs even better.\n\n## Related Projects\n\n**[@fotinakis](https://github.com/fotinakis/)** has created Swagger::Blocks - a DSL for pure Ruby code blocks: [swagger-blocks](https://github.com/fotinakis/swagger-blocks/)\n\nA [cors rack middleware for testing swagger apis](https://gist.github.com/richhollis/b98a8b0599860145ad86) designed to be used in Rails development environments.\n\n\n## More About Me\n\n[Rich Hollis](http://richhollis.co.uk)\n\n## Contributing\n\nWhen raising a Pull Request please ensure that you have provided good test coverage for the request you are making.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichhollis%2Fswagger-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichhollis%2Fswagger-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichhollis%2Fswagger-docs/lists"}