swagger_api 0.1.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +20 -0
- data/.gitignore +13 -0
- data/.gitlab-ci.yml +61 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +155 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/swagger_api.rb +123 -0
- data/lib/swagger_api/actions.rb +43 -0
- data/lib/swagger_api/column_schema.rb +41 -0
- data/lib/swagger_api/component_schema.rb +50 -0
- data/lib/swagger_api/components.rb +24 -0
- data/lib/swagger_api/concerns/columns.rb +24 -0
- data/lib/swagger_api/operations/base.rb +86 -0
- data/lib/swagger_api/operations/create.rb +39 -0
- data/lib/swagger_api/operations/delete.rb +20 -0
- data/lib/swagger_api/operations/index.rb +50 -0
- data/lib/swagger_api/operations/show.rb +11 -0
- data/lib/swagger_api/operations/update.rb +32 -0
- data/lib/swagger_api/paths.rb +52 -0
- data/lib/swagger_api/railtie.rb +6 -0
- data/lib/swagger_api/request_bodies.rb +28 -0
- data/lib/swagger_api/tasks/swagger.rake +13 -0
- data/lib/swagger_api/version.rb +3 -0
- data/swagger.yml +46 -0
- data/swagger_api.gemspec +38 -0
- metadata +162 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e65574433c97f417797c705be992693882b97e7e
|
4
|
+
data.tar.gz: b39fe5c5bd74b55c171ce1bcdcbfb381784c5569
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ce851013115a22221f5f16268b3330135ea150a72115a9f6116525928e2966879d01e4cfb8d15a36004c275a6d7ba5afed1efb35e866810b6bfce66f3c455600
|
7
|
+
data.tar.gz: de0b15d8e00b8a1ae458b7c1db47f83788eef26420d8cb626f9281bd673753507037c61944e6d0fc975bed5d1274570e3fe7492fe8a66396ee98672d68612db8
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
engines:
|
3
|
+
rubocop:
|
4
|
+
enabled: true
|
5
|
+
bundler-audit:
|
6
|
+
enabled: true
|
7
|
+
brakeman:
|
8
|
+
enabled: false
|
9
|
+
duplication:
|
10
|
+
enabled: true
|
11
|
+
config:
|
12
|
+
languages:
|
13
|
+
ruby:
|
14
|
+
mass_threshold: 30
|
15
|
+
fixme:
|
16
|
+
enabled: true
|
17
|
+
ratings:
|
18
|
+
paths:
|
19
|
+
- "**.rb"
|
20
|
+
- Gemfile.lock
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
stages:
|
2
|
+
- test
|
3
|
+
- deploy
|
4
|
+
|
5
|
+
rspec:
|
6
|
+
stage: test
|
7
|
+
image: registry.gitlab.com/fullmeasure/public/docker/rails-mysql-node:latest
|
8
|
+
variables:
|
9
|
+
MYSQL_ROOT_PASSWORD: 'root'
|
10
|
+
DB_ROOT_PASS: 'root'
|
11
|
+
RAILS_ENV: test
|
12
|
+
services:
|
13
|
+
- mysql:5.6
|
14
|
+
- redis:latest
|
15
|
+
before_script:
|
16
|
+
- bundle install --quiet
|
17
|
+
script:
|
18
|
+
- bundle exec rspec
|
19
|
+
artifacts:
|
20
|
+
name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA"
|
21
|
+
when: always
|
22
|
+
expire_in: 1 week
|
23
|
+
paths:
|
24
|
+
- coverage/
|
25
|
+
only:
|
26
|
+
- /^master$/
|
27
|
+
|
28
|
+
codequality:
|
29
|
+
stage: test
|
30
|
+
image: docker:latest
|
31
|
+
variables:
|
32
|
+
DOCKER_DRIVER: overlay
|
33
|
+
services:
|
34
|
+
- docker:dind
|
35
|
+
script:
|
36
|
+
- docker pull codeclimate/codeclimate
|
37
|
+
- docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate:0.69.0 init
|
38
|
+
- docker run --env CODECLIMATE_CODE="$PWD" --volume "$PWD":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate:0.69.0 analyze -f json > codeclimate.json || true
|
39
|
+
artifacts:
|
40
|
+
paths: [codeclimate.json]
|
41
|
+
|
42
|
+
|
43
|
+
release:
|
44
|
+
stage: deploy
|
45
|
+
image: ruby:2.3.1
|
46
|
+
before_script:
|
47
|
+
- git config --global user.email dev@fullmeasureed.com
|
48
|
+
- git config --global user.name fme-ci
|
49
|
+
- git remote remove origin
|
50
|
+
- git remote add origin https://fme-ci:${GITLAB_CI_TOKEN}@gitlab.com/$CI_PROJECT_PATH.git
|
51
|
+
- git fetch origin master
|
52
|
+
- git checkout master
|
53
|
+
- git branch -u origin/master
|
54
|
+
- gem install gem-release -v 2.0.0.rc.3
|
55
|
+
script:
|
56
|
+
- echo -e "---\n:rubygems_api_key:${RUBYGEMS_KEY}" > ~/.gem/credentials
|
57
|
+
- chmod 0600 ~/.gem/credentials
|
58
|
+
- cat ~/.gem/credentials
|
59
|
+
- gem bump patch --skip-ci --tag --push --release
|
60
|
+
only:
|
61
|
+
- /(^master$)/
|
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.3.6
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at samuel.birk@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
swagger_api (0.1.35)
|
5
|
+
active_attr
|
6
|
+
rails (>= 5.0)
|
7
|
+
rspec-rails
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actioncable (5.2.0)
|
13
|
+
actionpack (= 5.2.0)
|
14
|
+
nio4r (~> 2.0)
|
15
|
+
websocket-driver (>= 0.6.1)
|
16
|
+
actionmailer (5.2.0)
|
17
|
+
actionpack (= 5.2.0)
|
18
|
+
actionview (= 5.2.0)
|
19
|
+
activejob (= 5.2.0)
|
20
|
+
mail (~> 2.5, >= 2.5.4)
|
21
|
+
rails-dom-testing (~> 2.0)
|
22
|
+
actionpack (5.2.0)
|
23
|
+
actionview (= 5.2.0)
|
24
|
+
activesupport (= 5.2.0)
|
25
|
+
rack (~> 2.0)
|
26
|
+
rack-test (>= 0.6.3)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
29
|
+
actionview (5.2.0)
|
30
|
+
activesupport (= 5.2.0)
|
31
|
+
builder (~> 3.1)
|
32
|
+
erubi (~> 1.4)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
35
|
+
active_attr (0.10.3)
|
36
|
+
activemodel (>= 3.0.2, < 6.0)
|
37
|
+
activesupport (>= 3.0.2, < 6.0)
|
38
|
+
activejob (5.2.0)
|
39
|
+
activesupport (= 5.2.0)
|
40
|
+
globalid (>= 0.3.6)
|
41
|
+
activemodel (5.2.0)
|
42
|
+
activesupport (= 5.2.0)
|
43
|
+
activerecord (5.2.0)
|
44
|
+
activemodel (= 5.2.0)
|
45
|
+
activesupport (= 5.2.0)
|
46
|
+
arel (>= 9.0)
|
47
|
+
activestorage (5.2.0)
|
48
|
+
actionpack (= 5.2.0)
|
49
|
+
activerecord (= 5.2.0)
|
50
|
+
marcel (~> 0.3.1)
|
51
|
+
activesupport (5.2.0)
|
52
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
53
|
+
i18n (>= 0.7, < 2)
|
54
|
+
minitest (~> 5.1)
|
55
|
+
tzinfo (~> 1.1)
|
56
|
+
arel (9.0.0)
|
57
|
+
builder (3.2.3)
|
58
|
+
concurrent-ruby (1.0.5)
|
59
|
+
crass (1.0.4)
|
60
|
+
diff-lcs (1.3)
|
61
|
+
erubi (1.7.1)
|
62
|
+
globalid (0.4.1)
|
63
|
+
activesupport (>= 4.2.0)
|
64
|
+
i18n (1.0.0)
|
65
|
+
concurrent-ruby (~> 1.0)
|
66
|
+
loofah (2.2.2)
|
67
|
+
crass (~> 1.0.2)
|
68
|
+
nokogiri (>= 1.5.9)
|
69
|
+
mail (2.7.0)
|
70
|
+
mini_mime (>= 0.1.1)
|
71
|
+
marcel (0.3.2)
|
72
|
+
mimemagic (~> 0.3.2)
|
73
|
+
method_source (0.9.0)
|
74
|
+
mimemagic (0.3.2)
|
75
|
+
mini_mime (1.0.0)
|
76
|
+
mini_portile2 (2.3.0)
|
77
|
+
minitest (5.11.3)
|
78
|
+
nio4r (2.3.0)
|
79
|
+
nokogiri (1.8.2)
|
80
|
+
mini_portile2 (~> 2.3.0)
|
81
|
+
rack (2.0.4)
|
82
|
+
rack-test (1.0.0)
|
83
|
+
rack (>= 1.0, < 3)
|
84
|
+
rails (5.2.0)
|
85
|
+
actioncable (= 5.2.0)
|
86
|
+
actionmailer (= 5.2.0)
|
87
|
+
actionpack (= 5.2.0)
|
88
|
+
actionview (= 5.2.0)
|
89
|
+
activejob (= 5.2.0)
|
90
|
+
activemodel (= 5.2.0)
|
91
|
+
activerecord (= 5.2.0)
|
92
|
+
activestorage (= 5.2.0)
|
93
|
+
activesupport (= 5.2.0)
|
94
|
+
bundler (>= 1.3.0)
|
95
|
+
railties (= 5.2.0)
|
96
|
+
sprockets-rails (>= 2.0.0)
|
97
|
+
rails-dom-testing (2.0.3)
|
98
|
+
activesupport (>= 4.2.0)
|
99
|
+
nokogiri (>= 1.6)
|
100
|
+
rails-html-sanitizer (1.0.4)
|
101
|
+
loofah (~> 2.2, >= 2.2.2)
|
102
|
+
railties (5.2.0)
|
103
|
+
actionpack (= 5.2.0)
|
104
|
+
activesupport (= 5.2.0)
|
105
|
+
method_source
|
106
|
+
rake (>= 0.8.7)
|
107
|
+
thor (>= 0.18.1, < 2.0)
|
108
|
+
rake (10.5.0)
|
109
|
+
rspec (3.7.0)
|
110
|
+
rspec-core (~> 3.7.0)
|
111
|
+
rspec-expectations (~> 3.7.0)
|
112
|
+
rspec-mocks (~> 3.7.0)
|
113
|
+
rspec-core (3.7.1)
|
114
|
+
rspec-support (~> 3.7.0)
|
115
|
+
rspec-expectations (3.7.0)
|
116
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
117
|
+
rspec-support (~> 3.7.0)
|
118
|
+
rspec-mocks (3.7.0)
|
119
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
120
|
+
rspec-support (~> 3.7.0)
|
121
|
+
rspec-rails (3.7.2)
|
122
|
+
actionpack (>= 3.0)
|
123
|
+
activesupport (>= 3.0)
|
124
|
+
railties (>= 3.0)
|
125
|
+
rspec-core (~> 3.7.0)
|
126
|
+
rspec-expectations (~> 3.7.0)
|
127
|
+
rspec-mocks (~> 3.7.0)
|
128
|
+
rspec-support (~> 3.7.0)
|
129
|
+
rspec-support (3.7.1)
|
130
|
+
sprockets (3.7.1)
|
131
|
+
concurrent-ruby (~> 1.0)
|
132
|
+
rack (> 1, < 3)
|
133
|
+
sprockets-rails (3.2.1)
|
134
|
+
actionpack (>= 4.0)
|
135
|
+
activesupport (>= 4.0)
|
136
|
+
sprockets (>= 3.0.0)
|
137
|
+
thor (0.20.0)
|
138
|
+
thread_safe (0.3.6)
|
139
|
+
tzinfo (1.2.5)
|
140
|
+
thread_safe (~> 0.1)
|
141
|
+
websocket-driver (0.7.0)
|
142
|
+
websocket-extensions (>= 0.1.0)
|
143
|
+
websocket-extensions (0.1.3)
|
144
|
+
|
145
|
+
PLATFORMS
|
146
|
+
ruby
|
147
|
+
|
148
|
+
DEPENDENCIES
|
149
|
+
bundler (~> 1.16)
|
150
|
+
rake (~> 10.0)
|
151
|
+
rspec (~> 3.0)
|
152
|
+
swagger_api!
|
153
|
+
|
154
|
+
BUNDLED WITH
|
155
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 samuelbirk
|
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
|
13
|
+
all 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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Swagger::Api
|
2
|
+
|
3
|
+
A gem to make swagger documentation easier to create
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'swagger-api'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install swagger-api
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Create a swagger.yml and place it in you gem directory (see swagger.yml in root directory for an example)
|
24
|
+
|
25
|
+
$ bundle exec rake swagger:api
|
26
|
+
|
27
|
+
This will create
|
28
|
+
|
29
|
+
## Development
|
30
|
+
|
31
|
+
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.
|
32
|
+
|
33
|
+
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).
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://gitlab.com/fullmeasure/swagger-api/swagger-api. 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.
|
38
|
+
|
39
|
+
## License
|
40
|
+
|
41
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
42
|
+
|
43
|
+
## Code of Conduct
|
44
|
+
|
45
|
+
Everyone interacting in the Swagger::Api project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/swagger-api/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "swagger/api"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|