jsonapi-swagger 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/generators/jsonapi/swagger/templates/swagger.rb.erb +4 -0
- data/lib/jsonapi/swagger/railtie.rb +1 -1
- data/lib/jsonapi/swagger/version.rb +1 -1
- metadata +2 -3
- data/LICENSE.md +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2396430a85aede1cfd926f160bde4437a848492306b4faaf2e153287140b5f1
|
4
|
+
data.tar.gz: 9f09eb3b646ab27c3357d93c5b1ad542f8abb507186ac476b9ec17c98df10426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13d71fa7dcc74a753a8f5ce78078e70031eb95b2bd9f10f71a1ea16c644c86fa8909b2766f65cdc9ff7e91a1432824983e70a5647e2956c3243c034f5b0f9c25
|
7
|
+
data.tar.gz: 8063865a8234b71e50f0593f176c6b3e796f5c4a932022380649739ef677d62336b39a52bf0c90359381ae93b9f493a4ba4d97f66ee54409a1fa0c1f248c6d06
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Generate JSONAPI Swagger Doc.
|
4
4
|
|
5
|
-
[![Gem Version](https://img.shields.io/gem/v/jsonapi-swagger.svg)](https://rubygems.org/gems/jsonapi-swagger) [![GitHub license](https://img.shields.io/github/license/superiorlu/jsonapi-swagger.svg)](https://github.com/superiorlu/jsonapi-swagger/blob/master/LICENSE
|
5
|
+
[![Gem Version](https://img.shields.io/gem/v/jsonapi-swagger.svg)](https://rubygems.org/gems/jsonapi-swagger) [![GitHub license](https://img.shields.io/github/license/superiorlu/jsonapi-swagger.svg)](https://github.com/superiorlu/jsonapi-swagger/blob/master/LICENSE)
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -11,7 +11,9 @@ RSpec.describe '<%= resouces_name %>', type: :request do
|
|
11
11
|
tags '<%= route_resouces %>'
|
12
12
|
produces 'application/vnd.api+json'
|
13
13
|
parameter name: :'page[number]', in: :query, type: :string, description: '<%= t(:page_num) %>', required: false
|
14
|
+
<% if relationships.present? -%>
|
14
15
|
parameter name: :include, in: :query, type: :string, description: '<%= t(:include_related_data) %>', required: false
|
16
|
+
<% end -%>
|
15
17
|
<% filters.each do |filter_attr, filter_config| -%>
|
16
18
|
parameter name: :'filter[<%= filter_attr %>]', in: :query, type: :string, description: '<%= t(:filter_field) %>', <% if filter_config[:default] -%>default: '<%= safe_encode(filter_config[:default]) %>',<% end %>required: false
|
17
19
|
<% end -%>
|
@@ -99,7 +101,9 @@ RSpec.describe '<%= resouces_name %>', type: :request do
|
|
99
101
|
tags '<%= route_resouces %>'
|
100
102
|
produces 'application/vnd.api+json'
|
101
103
|
parameter name: :id, in: :path, type: :integer, description: 'ID', required: true
|
104
|
+
<% if relationships.present? -%>
|
102
105
|
parameter name: :include, in: :query, type: :string, description: '<%= t(:include_related_data) %>', required: false
|
106
|
+
<% end -%>
|
103
107
|
parameter name: :'fields[<%= route_resouces %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
|
104
108
|
<% relationships.each_value do |relation| -%>
|
105
109
|
parameter name: :'fields[<%= relation.class_name.tableize %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
|
@@ -6,7 +6,7 @@ module Jsonapi
|
|
6
6
|
initializer 'jsonapi-swagger-i18n' do |app|
|
7
7
|
locates = app.config.i18n.available_locales
|
8
8
|
locates_dir = File.expand_path('../../i18n', __dir__)
|
9
|
-
locates.each do |loc|
|
9
|
+
Array(locates).each do |loc|
|
10
10
|
locate_file = File.join(locates_dir, "#{loc}.yml")
|
11
11
|
I18n.load_path.push(locate_file) if File.exist?(locate_file) && !I18n.load_path.include?(locate_file)
|
12
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-swagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YingRui Lu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,7 +73,6 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- LICENSE.md
|
77
76
|
- README.md
|
78
77
|
- lib/generators/jsonapi/swagger/USAGE
|
79
78
|
- lib/generators/jsonapi/swagger/swagger_generator.rb
|
data/LICENSE.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2019 superiorlu
|
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.
|