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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 742c2f935861a3ea96177cc137ef93f18f36e8e5
4
- data.tar.gz: c39792ac492988b5c7d9c0bbdf5da8d12456be6c
3
+ metadata.gz: 37839cf58432418292da7ad42a9a2b1f0b8d138c
4
+ data.tar.gz: 7b3dd190b7a321e495f9f6b1bf9985972a23449c
5
5
  SHA512:
6
- metadata.gz: 8caaf3f23d5f3fc94b12b14ca48d198cff2faa218d5dd02cbdced2dd7b23d3d4ebb9a080372dbfe0d82fc068b063f8cc2205934e8f246b36aeb0697bc5bbcd98
7
- data.tar.gz: 3093590ed562650781c624c91a9873da4253d112ab16a24d365f6e425bbcebba75f29d15e30ea0373e66853bcdb3fe24e6686b0f8387f1b598e2e23963bc2dc6
6
+ metadata.gz: fc0fc77317518b9a5cc704308925ae43d46f5cd407c30cf54748a3a8df10b82133da97df8449a482e5eda0b8c19f2ce33030fcbd73d84ab3712bfb4b2b10edb7
7
+ data.tar.gz: a2bd26455df7c27ca81297989afe94d5b6252ce7689617c70ca449dd1a78e6195614bcc1392f559b634adbab3ebe060cfc6378fa675ade144e2380064d7b1a2e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jsonapi-swagger-blocks-generator (0.1.1)
4
+ jsonapi-swagger-blocks-generator (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -134,4 +134,4 @@ DEPENDENCIES
134
134
  simplecov
135
135
 
136
136
  BUNDLED WITH
137
- 1.16.1
137
+ 1.16.4
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # JSONAPI Swagger Blocks Generator
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator.svg)](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator) [![Gem Version](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator.svg)](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator) [![Maintainability](https://api.codeclimate.com/v1/badges/2de3e3c4e8fb1543a687/maintainability)](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> [![Build Status](https://travis-ci.org/g13ydson/jsonapi-swagger-blocks-generator.svg?branch=master)](https://travis-ci.org/g13ydson/jsonapi-swagger-blocks-generator)
3
+ [![Gem Version](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator.svg)](https://badge.fury.io/rb/jsonapi-swagger-blocks-generator) [![Maintainability](https://api.codeclimate.com/v1/badges/2de3e3c4e8fb1543a687/maintainability)](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> [![Build Status](https://travis-ci.org/g13ydson/jsonapi-swagger-blocks-generator.svg?branch=master)](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 %>/{<%= model_name.singularize.underscore %>_id}/<%= relationship %>" do
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 %>"
@@ -4,7 +4,7 @@ module Jsonapi
4
4
  module Swagger
5
5
  module Blocks
6
6
  module Generator
7
- VERSION = "0.1.2".freeze
7
+ VERSION = "0.1.3".freeze
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-swagger-blocks-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleydson Tavares