jsonapi-swagger-blocks-generator 0.1.2 → 0.1.3
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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/generators/jsonapi/templates/controller_template.template +19 -12
- data/lib/jsonapi/swagger/blocks/generator/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37839cf58432418292da7ad42a9a2b1f0b8d138c
|
4
|
+
data.tar.gz: 7b3dd190b7a321e495f9f6b1bf9985972a23449c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc0fc77317518b9a5cc704308925ae43d46f5cd407c30cf54748a3a8df10b82133da97df8449a482e5eda0b8c19f2ce33030fcbd73d84ab3712bfb4b2b10edb7
|
7
|
+
data.tar.gz: a2bd26455df7c27ca81297989afe94d5b6252ce7689617c70ca449dd1a78e6195614bcc1392f559b634adbab3ebe060cfc6378fa675ade144e2380064d7b1a2e
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# JSONAPI Swagger Blocks Generator
|
2
2
|
|
3
|
-
[](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator) [](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator) [](https://codeclimate.com/github/g13ydson/jsonapi-swagger-blocks-generator/maintainability) <a href="https://codeclimate.com/github/g13ydson/jsonapi-swagger-blocks-generator/test_coverage"><img src="https://api.codeclimate.com/v1/badges/2de3e3c4e8fb1543a687/test_coverage" /></a> [](https://travis-ci.org/g13ydson/jsonapi-swagger-blocks-generator)
|
4
4
|
|
5
5
|
creates swagger blocks files based on the JSONAPI::Resource file http://jsonapi-resources.com/
|
6
6
|
|
@@ -6,7 +6,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
6
6
|
operation :get do
|
7
7
|
key :summary, "Index <%= model_name.pluralize.underscore %>"
|
8
8
|
key :produces, [
|
9
|
-
"application/json"
|
9
|
+
"application/vnd.api+json"
|
10
10
|
]
|
11
11
|
key :tags, [
|
12
12
|
"<%= model_name.singularize.underscore %>"
|
@@ -46,7 +46,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
46
46
|
operation :get do
|
47
47
|
key :summary, "Show <%= model_name.singularize.underscore %>"
|
48
48
|
key :produces, [
|
49
|
-
"application/json"
|
49
|
+
"application/vnd.api+json"
|
50
50
|
]
|
51
51
|
key :tags, [
|
52
52
|
"<%= model_name.singularize.underscore %>"
|
@@ -93,7 +93,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
93
93
|
operation :post do
|
94
94
|
key :summary, "Create <%= model_name.singularize.underscore %>"
|
95
95
|
key :produces, [
|
96
|
-
"application/json"
|
96
|
+
"application/vnd.api+json"
|
97
97
|
]
|
98
98
|
key :tags, [
|
99
99
|
"<%= model_name.singularize.underscore %>"
|
@@ -154,7 +154,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
154
154
|
operation :put do
|
155
155
|
key :summary, "Update <%= model_name.singularize.underscore %>"
|
156
156
|
key :produces, [
|
157
|
-
"application/json"
|
157
|
+
"application/vnd.api+json"
|
158
158
|
]
|
159
159
|
key :tags, [
|
160
160
|
"<%= model_name.singularize.underscore %>"
|
@@ -221,7 +221,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
221
221
|
operation :patch do
|
222
222
|
key :summary, "Update <%= model_name.singularize.underscore %>"
|
223
223
|
key :produces, [
|
224
|
-
"application/json"
|
224
|
+
"application/vnd.api+json"
|
225
225
|
]
|
226
226
|
key :tags, [
|
227
227
|
"<%= model_name.singularize.underscore %>"
|
@@ -288,7 +288,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
288
288
|
operation :delete do
|
289
289
|
key :summary, "Delete <%= model_name.singularize.underscore %>"
|
290
290
|
key :produces, [
|
291
|
-
"application/json"
|
291
|
+
"application/vnd.api+json"
|
292
292
|
]
|
293
293
|
key :tags, [
|
294
294
|
"<%= model_name.singularize.underscore %>"
|
@@ -337,15 +337,22 @@ class <%= model.pluralize.camelcase %>Controller
|
|
337
337
|
<%- if relationships -%>
|
338
338
|
<%- relationships.keys.each do |relationship| -%>
|
339
339
|
|
340
|
-
swagger_path "/<%= model_name.pluralize.underscore %>/{
|
340
|
+
swagger_path "/<%= model_name.pluralize.underscore %>/{id}/<%= relationship %>" do
|
341
341
|
operation :get do
|
342
342
|
key :summary, "Show <%= relationship %> from <%= model_name.singularize.underscore %>"
|
343
343
|
key :produces, [
|
344
|
-
"application/json"
|
344
|
+
"application/vnd.api+json"
|
345
345
|
]
|
346
346
|
key :tags, [
|
347
347
|
"<%= model_name.singularize.underscore %>"
|
348
348
|
]
|
349
|
+
parameter do
|
350
|
+
key :name, :id
|
351
|
+
key :in, :path
|
352
|
+
key :description, "id of <%= model_name.singularize.underscore %>"
|
353
|
+
key :required, true
|
354
|
+
key :type, :integer
|
355
|
+
end
|
349
356
|
response 200 do
|
350
357
|
key :description, "Show <%= relationship %> from <%= model_name.singularize.underscore %>"
|
351
358
|
schema do
|
@@ -397,7 +404,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
397
404
|
operation :get do
|
398
405
|
key :summary, "Show <%= relationship %> from <%= model_name.singularize.underscore %>"
|
399
406
|
key :produces, [
|
400
|
-
"application/json"
|
407
|
+
"application/vnd.api+json"
|
401
408
|
]
|
402
409
|
key :tags, [
|
403
410
|
"<%= model_name.singularize.underscore %>"
|
@@ -470,7 +477,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
470
477
|
operation :put do
|
471
478
|
key :summary, "Update <%= relationship %> from <%= model_name.singularize.underscore %>"
|
472
479
|
key :produces, [
|
473
|
-
"application/json"
|
480
|
+
"application/vnd.api+json"
|
474
481
|
]
|
475
482
|
key :tags, [
|
476
483
|
"<%= model_name.singularize.underscore %>"
|
@@ -536,7 +543,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
536
543
|
operation :post do
|
537
544
|
key :summary, "Update <%= relationship %> from <%= model_name.singularize.underscore %>"
|
538
545
|
key :produces, [
|
539
|
-
"application/json"
|
546
|
+
"application/vnd.api+json"
|
540
547
|
]
|
541
548
|
key :tags, [
|
542
549
|
"<%= model_name.singularize.underscore %>"
|
@@ -602,7 +609,7 @@ class <%= model.pluralize.camelcase %>Controller
|
|
602
609
|
operation :delete do
|
603
610
|
key :summary, "Delete <%= relationship %> from <%= model_name.singularize.underscore %>"
|
604
611
|
key :produces, [
|
605
|
-
"application/json"
|
612
|
+
"application/vnd.api+json"
|
606
613
|
]
|
607
614
|
key :tags, [
|
608
615
|
"<%= model_name.singularize.underscore %>"
|