swagger_docs_generator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +36 -0
- data/Rakefile +8 -0
- data/lib/generators/swagger_docs_generator/initializer_generator.rb +29 -0
- data/lib/swagger_docs_generator.rb +21 -0
- data/lib/swagger_docs_generator/configuration/configuration.rb +41 -0
- data/lib/swagger_docs_generator/configuration/configuration_info.rb +33 -0
- data/lib/swagger_docs_generator/extractor.rb +49 -0
- data/lib/swagger_docs_generator/generator.rb +65 -0
- data/lib/swagger_docs_generator/info.rb +21 -0
- data/lib/swagger_docs_generator/metadata/configuration.rb +44 -0
- data/lib/swagger_docs_generator/metadata/controller.rb +26 -0
- data/lib/swagger_docs_generator/metadata/info.rb +44 -0
- data/lib/swagger_docs_generator/metadata/metadata.rb +28 -0
- data/lib/swagger_docs_generator/metadata/path.rb +24 -0
- data/lib/swagger_docs_generator/metadata/tag.rb +24 -0
- data/lib/swagger_docs_generator/methods.rb +21 -0
- data/lib/swagger_docs_generator/parser/action.rb +66 -0
- data/lib/swagger_docs_generator/parser/actions/actions.rb +42 -0
- data/lib/swagger_docs_generator/parser/actions/consumes.rb +25 -0
- data/lib/swagger_docs_generator/parser/actions/description.rb +17 -0
- data/lib/swagger_docs_generator/parser/actions/parameters.rb +17 -0
- data/lib/swagger_docs_generator/parser/actions/produces.rb +25 -0
- data/lib/swagger_docs_generator/parser/actions/response.rb +25 -0
- data/lib/swagger_docs_generator/parser/actions/summary.rb +17 -0
- data/lib/swagger_docs_generator/parser/actions/tags.rb +23 -0
- data/lib/swagger_docs_generator/parser/controller.rb +40 -0
- data/lib/swagger_docs_generator/parser/parser.rb +36 -0
- data/lib/swagger_docs_generator/railtie.rb +15 -0
- data/lib/tasks/swagger.rake +8 -0
- metadata +207 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6671b4df077b9fb55feda1f126ee870194a31bd6
|
4
|
+
data.tar.gz: 31a02536ca38fc3c076c1c77af0a6d9634a1a045
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 972e8e0407cd1b40c3121f46abd3ddb3434a77c330cbab22aef9304248a7a47b19471ee39443cfe0b4cbd8031703cb5f943c375e5df4f7c083b2d43bb94b59d7
|
7
|
+
data.tar.gz: 151b024e6714eac2b4a323865e8891a08c1b11af978bddbcef5c385e7c3367304cf8439ab891df255fe30dd990e324e328b51fb02aecf6fe3d18bf0ae543ce6c
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 VAILLANT Jeremy
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Swagger::Docs::Generator
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/swagger/docs/generator`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'swagger-docs-generator'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install swagger-docs-generator
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/swagger-docs-generator. 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.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Generator Rails
|
5
|
+
#
|
6
|
+
# Create a initializer for rails application
|
7
|
+
class InitializerGenerator < Rails::Generators::Base
|
8
|
+
desc 'Generate a initializer for Swagger Docs Generator'
|
9
|
+
INITIALIZER = <<-INIT
|
10
|
+
# frozen_string_literal: true
|
11
|
+
|
12
|
+
SwaggerDocsGenerator.configure do |config|
|
13
|
+
config.swagger = '2.2.4'
|
14
|
+
config.base_path = '/'
|
15
|
+
config.host = 'localhost:3000'
|
16
|
+
end
|
17
|
+
|
18
|
+
SwaggerDocsGenerator.configure_info do |info|
|
19
|
+
info.title = 'API example.com'
|
20
|
+
info.version = '1.0.0'
|
21
|
+
end
|
22
|
+
INIT
|
23
|
+
|
24
|
+
# Create initializer
|
25
|
+
def copy_initializer
|
26
|
+
initializer 'swagger_docs_generator.rb', INITIALIZER
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Information for this gem
|
3
|
+
require 'swagger_docs_generator/info'
|
4
|
+
|
5
|
+
# Class configuration
|
6
|
+
require 'swagger_docs_generator/configuration/configuration'
|
7
|
+
require 'swagger_docs_generator/configuration/configuration_info'
|
8
|
+
|
9
|
+
# Modules methods in a controller
|
10
|
+
require 'swagger_docs_generator/methods'
|
11
|
+
require 'swagger_docs_generator/parser/parser'
|
12
|
+
|
13
|
+
# Extractor verb
|
14
|
+
require 'swagger_docs_generator/extractor'
|
15
|
+
|
16
|
+
# Generator for swagger json file
|
17
|
+
require 'swagger_docs_generator/generator'
|
18
|
+
require 'swagger_docs_generator/metadata/metadata'
|
19
|
+
|
20
|
+
# Tasks
|
21
|
+
require 'swagger_docs_generator/railtie' if defined?(Rails)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :reek:Attribute
|
4
|
+
module SwaggerDocsGenerator
|
5
|
+
# # Configuration to swagger json file
|
6
|
+
#
|
7
|
+
# This class it's a DSL class. For customize default json file.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# SwaggerDocsGenerator.configure do |config|
|
11
|
+
# config.swagger = '2.0.0'
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# SwaggerDocsGenerator.config
|
15
|
+
# => #<SwaggerDocsGenerator::Configuration:0x007f8ae49138d8
|
16
|
+
# @swagger='2.0.0'>
|
17
|
+
#
|
18
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
19
|
+
class Configuration
|
20
|
+
attr_accessor :swagger, :base_path, :schemes, :consumes, :produces,
|
21
|
+
:host, :paths, :definitions, :security_definitions,
|
22
|
+
:security, :tags, :external_docs
|
23
|
+
|
24
|
+
SWAGGER = '2.0'
|
25
|
+
|
26
|
+
# Initalize default value (and requried) for json swagger file
|
27
|
+
def initialize
|
28
|
+
@swagger = SWAGGER
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class << self
|
33
|
+
def configure
|
34
|
+
block_given? ? yield(config) : config
|
35
|
+
end
|
36
|
+
|
37
|
+
def config
|
38
|
+
@config ||= Configuration.new
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :reek:Attribute
|
4
|
+
module SwaggerDocsGenerator
|
5
|
+
# # Information element
|
6
|
+
#
|
7
|
+
# Create a Hash element for information to API doc.
|
8
|
+
#
|
9
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#info-object
|
10
|
+
class ConfigurationInfo
|
11
|
+
attr_accessor :title, :description, :terms_of_service, :contact, :license,
|
12
|
+
:version
|
13
|
+
|
14
|
+
TITLE = 'Title Example API'
|
15
|
+
VERSION = '1.0.0'
|
16
|
+
|
17
|
+
# Initialize required element
|
18
|
+
def initialize
|
19
|
+
@title = TITLE
|
20
|
+
@version = VERSION
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class << self
|
25
|
+
def configure_info
|
26
|
+
block_given? ? yield(info) : info
|
27
|
+
end
|
28
|
+
|
29
|
+
def info
|
30
|
+
@info ||= ConfigurationInfo.new
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Extractor routes info
|
5
|
+
#
|
6
|
+
# Give information about routes
|
7
|
+
class Extractor
|
8
|
+
def initialize(controller, action)
|
9
|
+
@action = action
|
10
|
+
@controller = controller
|
11
|
+
@routes = Rails.application.routes.routes
|
12
|
+
end
|
13
|
+
|
14
|
+
def verb
|
15
|
+
router do |route|
|
16
|
+
route.verb.source.to_s.delete('$' + '^')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def path
|
21
|
+
router do |route|
|
22
|
+
route.path.spec.to_s.gsub('(.:format)', '.json').gsub(':id', '{id}')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def rte_controller(rte)
|
29
|
+
rte[:controller].eql?(controller_name)
|
30
|
+
end
|
31
|
+
|
32
|
+
def rte_action(rte)
|
33
|
+
rte[:action].eql?(@action.to_s)
|
34
|
+
end
|
35
|
+
|
36
|
+
def controller_name
|
37
|
+
@controller.controller_name
|
38
|
+
end
|
39
|
+
|
40
|
+
def router
|
41
|
+
data = nil
|
42
|
+
@routes.map do |route|
|
43
|
+
rte = route.defaults
|
44
|
+
data = yield(route, rte) if rte_controller(rte) && rte_action(rte)
|
45
|
+
end
|
46
|
+
data.downcase
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module SwaggerDocsGenerator
|
6
|
+
# # Generate JSON file
|
7
|
+
#
|
8
|
+
# Create a json file for swagger-ui service
|
9
|
+
#
|
10
|
+
# @!attribute [r] swagger_file
|
11
|
+
# @return [String] the swagger file name with path
|
12
|
+
class Generator
|
13
|
+
attr_reader :swagger_file
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@file = 'swagger.json'
|
17
|
+
@path = File.join(Dir.pwd, '/public')
|
18
|
+
@swagger_file = File.join(@path, @file)
|
19
|
+
end
|
20
|
+
|
21
|
+
# Open or create a swagger.json file
|
22
|
+
def generate_swagger_file
|
23
|
+
delete_file_before
|
24
|
+
create_version_folder
|
25
|
+
File.open(@swagger_file, 'a+') { |file| file.puts agregate_metadata }
|
26
|
+
end
|
27
|
+
|
28
|
+
# Delete files temporary
|
29
|
+
def delete_emporary_files
|
30
|
+
version = File.join(@path, SwaggerDocsGenerator.configure_info.version)
|
31
|
+
Dir.delete(File.join(@path, version))
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
attr_reader :meta
|
37
|
+
|
38
|
+
def delete_file_before
|
39
|
+
File.delete(@swagger_file) if File.exist?(@swagger_file)
|
40
|
+
end
|
41
|
+
|
42
|
+
def create_version_folder
|
43
|
+
version = File.join(@path, SwaggerDocsGenerator.configure_info.version)
|
44
|
+
FileUtils.mkdir_p(version) unless File.directory?(version)
|
45
|
+
end
|
46
|
+
|
47
|
+
# :reek:UtilityFunction
|
48
|
+
def write_in_swagger_file
|
49
|
+
hash = {}
|
50
|
+
hash.merge!(MetadataConfiguration.new.construct_swagger_file)
|
51
|
+
hash.merge!(MetadataInfo.new.construct_swagger_file)
|
52
|
+
hash.merge!(MetadataPath.new.construct_swagger_file)
|
53
|
+
hash.merge!(MetadataTag.new.construct_swagger_file)
|
54
|
+
end
|
55
|
+
|
56
|
+
def agregate_metadata
|
57
|
+
case defined?(Rails) && Rails.env
|
58
|
+
when 'production' || 'test'
|
59
|
+
write_in_swagger_file.to_json
|
60
|
+
else
|
61
|
+
JSON.pretty_generate write_in_swagger_file
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :reek:TooManyConstants
|
4
|
+
module SwaggerDocsGenerator
|
5
|
+
# Name to gem
|
6
|
+
GEM = 'swagger_docs_generator'
|
7
|
+
# Version to gem
|
8
|
+
VERSION = '0.1.0'
|
9
|
+
# Authors contributed to gem
|
10
|
+
AUTHORS = ['VAILLANT Jeremy'].freeze
|
11
|
+
# Email to ahuthors
|
12
|
+
EMAILS = ['jeremy@dazzl.tv'].freeze
|
13
|
+
# Short description
|
14
|
+
SUMMARY = 'Swagger UI json file'
|
15
|
+
# Describe gem
|
16
|
+
DESCRIPTION = 'Generates swagger-ui json file for rails-api'
|
17
|
+
# Homepage
|
18
|
+
HOMEPAGE = 'https://github.com/Dev-Crea/swagger-docs-generator'
|
19
|
+
# License
|
20
|
+
LICENSE = 'MIT'
|
21
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Metadata generated
|
5
|
+
#
|
6
|
+
# Generate metadata for block schema in swagger specification
|
7
|
+
#
|
8
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schema
|
9
|
+
class MetadataConfiguration < Metadata
|
10
|
+
def initialize
|
11
|
+
@config = SwaggerDocsGenerator.configure
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def swagger
|
17
|
+
{ swagger: @config.swagger }
|
18
|
+
end
|
19
|
+
|
20
|
+
def base_path
|
21
|
+
{ basePath: @config.base_path }
|
22
|
+
end
|
23
|
+
|
24
|
+
def schemes
|
25
|
+
{ schemes: @config.schemes }
|
26
|
+
end
|
27
|
+
|
28
|
+
def host
|
29
|
+
{ host: @config.host }
|
30
|
+
end
|
31
|
+
|
32
|
+
def definitions
|
33
|
+
{ definitions: @config.definitions }
|
34
|
+
end
|
35
|
+
|
36
|
+
def external_docs
|
37
|
+
{ externalDocs: @config.external_docs }
|
38
|
+
end
|
39
|
+
|
40
|
+
def security
|
41
|
+
{ security: @config.security }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module SwaggerDocsGenerator
|
6
|
+
# # Metadata generated
|
7
|
+
#
|
8
|
+
# @abstract
|
9
|
+
# Abstract class for metadata provide to controlloer in Rails application
|
10
|
+
class MetadataController < Metadata
|
11
|
+
def initialize
|
12
|
+
# Reload all controller before parsing
|
13
|
+
Rails.application.eager_load!
|
14
|
+
@path = File.join(Dir.pwd, 'public',
|
15
|
+
SwaggerDocsGenerator.configure_info.version)
|
16
|
+
@controllers = ApplicationController.subclasses
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
attr_accessor :controllers, :path
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'swagger_docs_generator/metadata/path'
|
26
|
+
require 'swagger_docs_generator/metadata/tag'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Metadata generated
|
5
|
+
#
|
6
|
+
# Generate metadata for block info in swagger specification
|
7
|
+
#
|
8
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#info-object
|
9
|
+
class MetadataInfo < Metadata
|
10
|
+
def initialize
|
11
|
+
@config = SwaggerDocsGenerator.configure_info
|
12
|
+
end
|
13
|
+
|
14
|
+
def construct_swagger_file
|
15
|
+
{ info: super }
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
def title
|
21
|
+
{ title: @config.title }
|
22
|
+
end
|
23
|
+
|
24
|
+
def version
|
25
|
+
{ version: @config.version }
|
26
|
+
end
|
27
|
+
|
28
|
+
def description
|
29
|
+
{ description: @config.description }
|
30
|
+
end
|
31
|
+
|
32
|
+
def terms_of_service
|
33
|
+
{ terms_of_service: @config.terms_of_service }
|
34
|
+
end
|
35
|
+
|
36
|
+
def contact
|
37
|
+
{ contact: @config.contact }
|
38
|
+
end
|
39
|
+
|
40
|
+
def license
|
41
|
+
{ license: @config.license }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Metadata generated
|
5
|
+
#
|
6
|
+
# Metadata generated in swagger json file
|
7
|
+
class Metadata
|
8
|
+
def initialize
|
9
|
+
@config = nil
|
10
|
+
end
|
11
|
+
|
12
|
+
def construct_swagger_file
|
13
|
+
hash = {}
|
14
|
+
self.class.protected_instance_methods.each do |method|
|
15
|
+
hash.merge!(send(method)) unless @config.send(method).blank?
|
16
|
+
end
|
17
|
+
hash
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :config
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'swagger_docs_generator/metadata/configuration'
|
27
|
+
require 'swagger_docs_generator/metadata/info'
|
28
|
+
require 'swagger_docs_generator/metadata/controller'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Metadata generated
|
5
|
+
#
|
6
|
+
# Generate metadata for block paths in swagger specification
|
7
|
+
#
|
8
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#pathsObject
|
9
|
+
class MetadataPath < MetadataController
|
10
|
+
def initialize
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
# Each controller parsed
|
15
|
+
def construct_swagger_file
|
16
|
+
hash = {}
|
17
|
+
controllers.each do |controller|
|
18
|
+
file = File.join(path, "#{controller.controller_name}.json")
|
19
|
+
hash.merge!(JSON.parse(File.read(file))['paths']) if File.exist?(file)
|
20
|
+
end
|
21
|
+
{ paths: hash }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Metadata generated
|
5
|
+
#
|
6
|
+
# Generate metadata for block tag in swagger specification
|
7
|
+
#
|
8
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#tagObject
|
9
|
+
class MetadataTag < MetadataController
|
10
|
+
def initialize
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
# Create tag
|
15
|
+
def construct_swagger_file
|
16
|
+
array = []
|
17
|
+
controllers.each do |controller|
|
18
|
+
file = File.join(path, "#{controller.controller_name}.json")
|
19
|
+
array.push(JSON.parse(File.read(file))['tags']) if File.exist?(file)
|
20
|
+
end
|
21
|
+
{ tags: array }
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :reek:UtilityFunction
|
4
|
+
module SwaggerDocsGenerator
|
5
|
+
# # Methods for controller
|
6
|
+
#
|
7
|
+
# Methods adding to controller parsing in rails appliation
|
8
|
+
module Methods
|
9
|
+
# Create json file for controller
|
10
|
+
def swagger_controller(controller, description)
|
11
|
+
parse = ParserController.new(controller, description)
|
12
|
+
parse.adding_tag
|
13
|
+
end
|
14
|
+
|
15
|
+
# Complete json file with datas to method and controller, controller reading
|
16
|
+
def swagger_doc(controller, action, data = {})
|
17
|
+
parse = ParserAction.new(controller, action, data)
|
18
|
+
parse.adding_path
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'swagger_docs_generator/parser/actions/actions'
|
4
|
+
|
5
|
+
module SwaggerDocsGenerator
|
6
|
+
# # Parse action in controller classe to Rails application. It's adding
|
7
|
+
# paths to swagger docs file.
|
8
|
+
class ParserAction < Parser
|
9
|
+
def initialize(controller, action, data)
|
10
|
+
super(controller)
|
11
|
+
@action = action
|
12
|
+
@data = data
|
13
|
+
end
|
14
|
+
|
15
|
+
def adding_path
|
16
|
+
json = JSON.parse(File.read(controller_file))
|
17
|
+
File.open(controller_file, 'w') do |file|
|
18
|
+
path_exist(json, construct_routes)
|
19
|
+
file.puts(JSON.pretty_generate(json))
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
# :reek:UtilityFunction
|
26
|
+
def path_exist(json, hash)
|
27
|
+
old_route = json['paths']
|
28
|
+
|
29
|
+
keys_new = hash.keys[0]
|
30
|
+
keys_old = old_route.keys[0]
|
31
|
+
|
32
|
+
if keys_new.to_s.eql?(keys_old.to_s)
|
33
|
+
old_route[keys_old].merge!(hash[keys_new])
|
34
|
+
else
|
35
|
+
old_route.merge!(hash)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def construct_routes
|
40
|
+
extract = Extractor.new(controller, @action)
|
41
|
+
verb = extract.verb
|
42
|
+
path = extract.path
|
43
|
+
verb.eql?('put') ? route_update(path, verb) : route(path, verb)
|
44
|
+
end
|
45
|
+
|
46
|
+
def super_hash
|
47
|
+
hash = {}
|
48
|
+
SwaggerDocsGenerator::Actions::Actions.descendants.each do |klass|
|
49
|
+
hash.merge!(klass.new(expect_tag(klass)).hash)
|
50
|
+
end
|
51
|
+
hash
|
52
|
+
end
|
53
|
+
|
54
|
+
def expect_tag(klass)
|
55
|
+
klass.eql?(Actions::Tags) ? controller_name : @data
|
56
|
+
end
|
57
|
+
|
58
|
+
def route(path, verb)
|
59
|
+
{ "#{path}": { "#{verb}": super_hash } }
|
60
|
+
end
|
61
|
+
|
62
|
+
def route_update(path, verb)
|
63
|
+
{ "#{path}": { "#{verb}": super_hash }.merge!(patch: super_hash) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test value in actions
|
6
|
+
#
|
7
|
+
# @abstract classes for all actions class
|
8
|
+
# @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operation-object
|
9
|
+
class Actions
|
10
|
+
attr_reader :hash, :key
|
11
|
+
|
12
|
+
def initialize(key)
|
13
|
+
@key = key
|
14
|
+
@hash = { @key => {} }
|
15
|
+
end
|
16
|
+
|
17
|
+
def hash
|
18
|
+
@hash[@key] ? @hash : {}
|
19
|
+
end
|
20
|
+
|
21
|
+
# List to all childrens
|
22
|
+
def self.descendants
|
23
|
+
ObjectSpace.each_object(Class).select { |klass| klass < self }
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def complete_hash(data)
|
29
|
+
raw ||= data[@key]
|
30
|
+
@hash[@key] = raw
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
require 'swagger_docs_generator/parser/actions/tags'
|
37
|
+
require 'swagger_docs_generator/parser/actions/summary'
|
38
|
+
require 'swagger_docs_generator/parser/actions/description'
|
39
|
+
require 'swagger_docs_generator/parser/actions/response'
|
40
|
+
require 'swagger_docs_generator/parser/actions/consumes'
|
41
|
+
require 'swagger_docs_generator/parser/actions/produces'
|
42
|
+
require 'swagger_docs_generator/parser/actions/parameters'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :consumes
|
6
|
+
#
|
7
|
+
# Complete consume field for action
|
8
|
+
class Consumes < Actions
|
9
|
+
VALUE = :consumes
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def complete_hash(data)
|
19
|
+
default = ['application/json']
|
20
|
+
raw = data.key?(key) ? data[key] : default
|
21
|
+
hash[key] = raw
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :description
|
6
|
+
#
|
7
|
+
# Complete description field for action
|
8
|
+
class Description < Actions
|
9
|
+
VALUE = :description
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :parameters
|
6
|
+
#
|
7
|
+
# Complete parameters field for action
|
8
|
+
class Parameters < Actions
|
9
|
+
VALUE = :parameters
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :produces
|
6
|
+
#
|
7
|
+
# Complete consume field for action
|
8
|
+
class Produces < Actions
|
9
|
+
VALUE = :produces
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def complete_hash(data)
|
19
|
+
default = ['application/json']
|
20
|
+
raw = data.key?(key) ? data[key] : default
|
21
|
+
hash[key] = raw
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :response
|
6
|
+
#
|
7
|
+
# Complete description field for action
|
8
|
+
class Response < Actions
|
9
|
+
VALUE = :responses
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def complete_hash(data)
|
19
|
+
default = { ok: { description: 'Request successfully processed.' } }
|
20
|
+
raw = data.key?(key) ? data[key] : default
|
21
|
+
hash[key] = raw
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :summary
|
6
|
+
#
|
7
|
+
# Complete summary field for action
|
8
|
+
class Summary < Actions
|
9
|
+
VALUE = :summary
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
module Actions
|
5
|
+
# # Test :tags
|
6
|
+
#
|
7
|
+
# Complete tags field for action
|
8
|
+
class Tags < Actions
|
9
|
+
VALUE = :tags
|
10
|
+
|
11
|
+
def initialize(data)
|
12
|
+
super(VALUE)
|
13
|
+
complete_hash(data)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def complete_hash(data)
|
19
|
+
hash[key] = [data]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Parse Controller classes
|
5
|
+
#
|
6
|
+
# Parse controller classes in Rails application. It's create temporary file
|
7
|
+
# and adding automaticaly tags element.
|
8
|
+
class ParserController < Parser
|
9
|
+
def initialize(controller, description)
|
10
|
+
super(controller)
|
11
|
+
prepare_file
|
12
|
+
@description = description
|
13
|
+
end
|
14
|
+
|
15
|
+
def adding_tag
|
16
|
+
json = JSON.parse(File.read(controller_file))
|
17
|
+
File.open(controller_file, 'w') do |file|
|
18
|
+
hash = construct_tags(@description)
|
19
|
+
json['tags'].merge!(hash)
|
20
|
+
file.puts(JSON.pretty_generate(json))
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def prepare_file
|
27
|
+
delete_file
|
28
|
+
base_file = { paths: {}, tags: {} }
|
29
|
+
File.open(controller_file, 'a+') { |file| file.puts(base_file.to_json) }
|
30
|
+
end
|
31
|
+
|
32
|
+
def delete_file
|
33
|
+
File.delete(controller_file) if File.exist?(controller_file)
|
34
|
+
end
|
35
|
+
|
36
|
+
def construct_tags(description)
|
37
|
+
{ name: controller_name, description: description }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Parse classes
|
5
|
+
#
|
6
|
+
# @abstract Classes for parsing Rails classes
|
7
|
+
#
|
8
|
+
# @!attribute [r] controller
|
9
|
+
# It's a name of controller parsed
|
10
|
+
# @!attribute [r] path
|
11
|
+
# It's a path to temporary file
|
12
|
+
# @!attribute [r] version
|
13
|
+
# It's a version to API documentation parsed
|
14
|
+
class Parser
|
15
|
+
attr_reader :controller, :path, :version
|
16
|
+
|
17
|
+
def initialize(controller)
|
18
|
+
@controller = controller
|
19
|
+
@path = File.join(Dir.pwd, 'public')
|
20
|
+
@version = SwaggerDocsGenerator.configure_info.version
|
21
|
+
end
|
22
|
+
|
23
|
+
def controller_file
|
24
|
+
File.join(@path, @version, "#{controller_name}.json")
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def controller_name
|
30
|
+
@controller.controller_name
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
require 'swagger_docs_generator/parser/controller'
|
36
|
+
require 'swagger_docs_generator/parser/action'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SwaggerDocsGenerator
|
4
|
+
# # Rake action
|
5
|
+
#
|
6
|
+
# Create an action for rails apps and executed with rake
|
7
|
+
class Railtie < Rails::Railtie
|
8
|
+
railtie_name :swagger
|
9
|
+
|
10
|
+
rake_tasks do
|
11
|
+
tasks = File.join(File.dirname(__FILE__), '../tasks', '*.rake')
|
12
|
+
Dir[tasks].each { |file_task| load file_task }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: swagger_docs_generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- VAILLANT Jeremy
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-01-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.5'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: overcommit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.34.2
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.34.2
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.42.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.42.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.9.5
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.9.5
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: reek
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '4.2'
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 4.2.4
|
93
|
+
type: :development
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '4.2'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 4.2.4
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: pry-byebug
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '3.4'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '3.4'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: json-schema-rspec
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 0.0.4
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 0.0.4
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rake
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '12.0'
|
138
|
+
type: :runtime
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '12.0'
|
145
|
+
description: Generates swagger-ui json file for rails-api
|
146
|
+
email:
|
147
|
+
- jeremy@dazzl.tv
|
148
|
+
executables: []
|
149
|
+
extensions: []
|
150
|
+
extra_rdoc_files: []
|
151
|
+
files:
|
152
|
+
- Gemfile
|
153
|
+
- LICENSE
|
154
|
+
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- lib/generators/swagger_docs_generator/initializer_generator.rb
|
157
|
+
- lib/swagger_docs_generator.rb
|
158
|
+
- lib/swagger_docs_generator/configuration/configuration.rb
|
159
|
+
- lib/swagger_docs_generator/configuration/configuration_info.rb
|
160
|
+
- lib/swagger_docs_generator/extractor.rb
|
161
|
+
- lib/swagger_docs_generator/generator.rb
|
162
|
+
- lib/swagger_docs_generator/info.rb
|
163
|
+
- lib/swagger_docs_generator/metadata/configuration.rb
|
164
|
+
- lib/swagger_docs_generator/metadata/controller.rb
|
165
|
+
- lib/swagger_docs_generator/metadata/info.rb
|
166
|
+
- lib/swagger_docs_generator/metadata/metadata.rb
|
167
|
+
- lib/swagger_docs_generator/metadata/path.rb
|
168
|
+
- lib/swagger_docs_generator/metadata/tag.rb
|
169
|
+
- lib/swagger_docs_generator/methods.rb
|
170
|
+
- lib/swagger_docs_generator/parser/action.rb
|
171
|
+
- lib/swagger_docs_generator/parser/actions/actions.rb
|
172
|
+
- lib/swagger_docs_generator/parser/actions/consumes.rb
|
173
|
+
- lib/swagger_docs_generator/parser/actions/description.rb
|
174
|
+
- lib/swagger_docs_generator/parser/actions/parameters.rb
|
175
|
+
- lib/swagger_docs_generator/parser/actions/produces.rb
|
176
|
+
- lib/swagger_docs_generator/parser/actions/response.rb
|
177
|
+
- lib/swagger_docs_generator/parser/actions/summary.rb
|
178
|
+
- lib/swagger_docs_generator/parser/actions/tags.rb
|
179
|
+
- lib/swagger_docs_generator/parser/controller.rb
|
180
|
+
- lib/swagger_docs_generator/parser/parser.rb
|
181
|
+
- lib/swagger_docs_generator/railtie.rb
|
182
|
+
- lib/tasks/swagger.rake
|
183
|
+
homepage: https://github.com/Dev-Crea/swagger-docs-generator
|
184
|
+
licenses:
|
185
|
+
- MIT
|
186
|
+
metadata: {}
|
187
|
+
post_install_message:
|
188
|
+
rdoc_options: []
|
189
|
+
require_paths:
|
190
|
+
- lib
|
191
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
192
|
+
requirements:
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: '0'
|
196
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
201
|
+
requirements: []
|
202
|
+
rubyforge_project:
|
203
|
+
rubygems_version: 2.5.1
|
204
|
+
signing_key:
|
205
|
+
specification_version: 4
|
206
|
+
summary: Swagger UI json file
|
207
|
+
test_files: []
|