jsonapi_swagger_helpers 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jsonapi_swagger_helpers/version.rb +1 -1
- data/lib/jsonapi_swagger_helpers.rb +20 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9b3f968a4f5d28cdde96e82960634eb620f152
|
4
|
+
data.tar.gz: a1a488145afdab452e203eca3301f02fb9c03e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b70ab34c7a2e0dcdb0aab4aea2d9d62cdcd598772f5eb186837a9e3ab79d169024de4721fa0b4893b14e30472ec544d2e7ede0620225f88628a28703448a58
|
7
|
+
data.tar.gz: 0b33c9e6fad54818f4fcf28a8bea33692d6a51a204f11e6caa2b6b5238133ce9d3f91ccfb946d023a4d50c505afed588f44f4ed1b4d4e269b60d83474e71d171
|
@@ -33,6 +33,7 @@ module JsonapiSwaggerHelpers
|
|
33
33
|
def jsonapi_index(controller)
|
34
34
|
jsonapi_includes(controller, :index)
|
35
35
|
jsonapi_filters(controller)
|
36
|
+
jsonapi_stats(controller)
|
36
37
|
jsonapi_pagination
|
37
38
|
jsonapi_sorting
|
38
39
|
end
|
@@ -73,6 +74,24 @@ module JsonapiSwaggerHelpers
|
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
77
|
+
def jsonapi_stats(controller)
|
78
|
+
controller._jsonapi_compliable.stats.each_pair do |stat_name, opts|
|
79
|
+
calculations = opts.calculations.keys - [:keys]
|
80
|
+
calculations = calculations.join('<br/>')
|
81
|
+
parameter do
|
82
|
+
key :name, "stats[#{stat_name}]"
|
83
|
+
key :in, :query
|
84
|
+
key :type, :string
|
85
|
+
key :required, false
|
86
|
+
key :description, "<a href='http://jsonapi.org/format/#document-meta'>JSONAPI meta data</a><br/> #{calculations}"
|
87
|
+
|
88
|
+
items do
|
89
|
+
key :model, :string
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
76
95
|
def jsonapi_pagination
|
77
96
|
parameter do
|
78
97
|
key :name, "page[size]"
|
@@ -113,7 +132,7 @@ module JsonapiSwaggerHelpers
|
|
113
132
|
key :in, :query
|
114
133
|
key :type, :string
|
115
134
|
key :required, false
|
116
|
-
key :description, "<a href='http://jsonapi.org/format/#fetching-includes'>JSONAPI includes</a>: #{includes}"
|
135
|
+
key :description, "<a href='http://jsonapi.org/format/#fetching-includes'>JSONAPI includes</a>: <br/> #{includes}"
|
117
136
|
end
|
118
137
|
end
|
119
138
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_swagger_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: swagger-blocks
|