jsonapi-swagger 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2451e820082b9b97f3ec0d6ba3fbf9d7f8bb17276a8b99ddd1901f60ccc7d214
4
- data.tar.gz: aacdea086604b346aa42d022478b8e088bd38f97d91c5b861be7593469eb8f10
3
+ metadata.gz: 38a21f228ae6527871910d16622f39218d08f0c8310d44efd7b9472dd089e172
4
+ data.tar.gz: e44e41b8e18e7eda501da5b20bf15fc79c35f6fa351340d8fdb13e2d2d7907b5
5
5
  SHA512:
6
- metadata.gz: 9dc72e490d688a7e84e87aed24f3c3071e0aea054eb3a4a5171532841f2f95cf715a278814767bf2ebe25be529a9cc2cff0c07ea38999215404badd750e44bfc
7
- data.tar.gz: 512a1a4ec818091f046e22a4cf3d95a14c5d6081940d8be1dc12e148ff515da8ba6a5af08e34beb0c3b1946497aee3268e26ed80bbfea722860b9cb34b6640b4
6
+ metadata.gz: 3a780d9bb80023f3c2350edb259cc45219e4acbb912381539e4a1bcf7c91307e2f858bba8f3c5eab484a5bb890b36a497fe41333204efcbe44c2a111ce5e3288
7
+ data.tar.gz: 7262ffab5f06d2e7423d6bff37bb8ae4aac44053aab3d9c0eef4a912db4af71a86858d490651e175b791d0ed90f81c914b2a46d761669353af23b169c395f657
data/LICENSE.md ADDED
@@ -0,0 +1,21 @@
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.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # JSONAPI Swagger
2
2
 
3
- Create a JSONAPI Swagger.
3
+ Generate JSONAPI Swagger Doc.
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.md)
4
6
 
5
7
  ## Installation
6
8
 
@@ -24,6 +26,12 @@ Or install it yourself as:
24
26
  rails generate jsonapi:swagger User # UserResponse < JSONAPI::Resource
25
27
  ```
26
28
 
29
+ ## Resource
30
+
31
+ - [JSONAPI](https://jsonapi.org/)
32
+ - [JSONAPI::Resources](http://jsonapi-resources.com/)
33
+ - [Rswag](https://github.com/domaindrivendev/rswag)
34
+
27
35
  ## Contributing
28
36
 
29
37
  Bug reports and pull requests are welcome on GitHub at https://github.com/superiorlu/jsonapi-swagger.
@@ -13,8 +13,8 @@ RSpec.describe '<%= resouces_name %>', type: :request do
13
13
  parameter name: :'page[number]', in: :query, type: :string, description: '<%= t(:page_num) %>', required: false
14
14
  parameter name: :include, in: :query, type: :string, description: '<%= t(:include_related_data) %>', required: false
15
15
  parameter name: :'fields[<%= route_resouces %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
16
- <% relationships.each_key do |relation| -%>
17
- parameter name: :'fields[<%= relation.to_s.pluralize %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
16
+ <% relationships.each_value do |relation| -%>
17
+ parameter name: :'fields[<%= relation.class_name.tableize %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
18
18
  <% end -%>
19
19
  response '200', '<%= t(:get_list) %>' do
20
20
  schema type: :object,
@@ -98,8 +98,8 @@ RSpec.describe '<%= resouces_name %>', type: :request do
98
98
  parameter name: :id, in: :path, type: :integer, description: 'ID', required: true
99
99
  parameter name: :include, in: :query, type: :string, description: '<%= t(:include_related_data) %>', required: false
100
100
  parameter name: :'fields[<%= route_resouces %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
101
- <% relationships.each_key do |relation| -%>
102
- parameter name: :'fields[<%= relation.to_s.pluralize %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
101
+ <% relationships.each_value do |relation| -%>
102
+ parameter name: :'fields[<%= relation.class_name.tableize %>]', in: :query, type: :string, description: '<%= t(:display_field) %>', required: false
103
103
  <% end -%>
104
104
  response '200', '<%= t(:get_detail) %>' do
105
105
  schema type: :object,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jsonapi
4
4
  module Swagger
5
- VERSION = '0.3.0'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  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.3.0
4
+ version: 0.3.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-04-25 00:00:00.000000000 Z
11
+ date: 2019-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,6 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - LICENSE.md
76
77
  - README.md
77
78
  - lib/generators/jsonapi/swagger/USAGE
78
79
  - lib/generators/jsonapi/swagger/swagger_generator.rb