https://github.com/dev-crea/swagger-docs-generator
https://github.com/dev-crea/swagger-docs-generator
gem rails ruby swagger
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dev-crea/swagger-docs-generator
- Owner: Dev-Crea
- License: mit
- Created: 2016-12-29T17:42:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-24T08:38:56.000Z (about 7 years ago)
- Last Synced: 2025-01-12T14:14:26.626Z (over 1 year ago)
- Topics: gem, rails, ruby, swagger
- Language: Ruby
- Size: 149 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Swagger::Docs::Generator | [![Travis][1]][2] [![Gem][21]][22] [![Docs][11]][12]
Generator for Swagger Apps ([Example with theme](https://github.com/Dev-Crea/swagger-ui))
## Menu
* [How to use](#how-to-use)
* [Installation](#installation)
* [Usage](#usage)
* [Development](#development)
* [Contributing](#contributing)
## How to use
### Installation
Add this line to your application's Gemfile :
```ruby
gem 'swagger-docs-generator'
```
And then execute :
```linux
bundle
```
Or install it yourself as :
```linux
gem install swagger_docs_generator
```
### Usage
Create initializer :
```linux
rails generator swagger_docs_generator:initializer
```
Create environment :
```linux
rails generator swagger_docs_generator:environment
```
Execute rake task for generated `swagger.json` :
```linux
rake swagger:docs
```
## Examples
```ruby
# frozen_string_literal: true
module V1
# Documentation API for AddressesController
class AddressesDoc < BaseDoc
CONTROLLER = V1::Geos::AddressesController
# Describe object Addresses
# ###
scontroller 'User Addresses management'
# Describe all actions
# ###
sdoc :show do
summary 'Show address'
responses do
status 200
schema { definition 'address' }
end
responses { status 404 }
responses { status 422 }
description <. This project is intended to
be a safe, welcoming space for collaboration, and contributors are expected to
adhere to the [Contributor Covenant](http://contributor-covenant.org)
code of conduct.
[1]: https://travis-ci.org/Dev-Crea/swagger-docs-generator.svg?branch=master
[2]: https://travis-ci.org/Dev-Crea/swagger-docs-generator
[11]: https://badge.fury.io/rb/swagger_docs_generator.svg
[12]: https://badge.fury.io/rb/swagger_docs_generator
[21]: https://inch-ci.org/github/Dev-Crea/swagger-docs-generator.svg
[22]: https://inch-ci.org/github/Dev-Crea/swagger-docs-generator