praxis 2.0.pre.7 → 2.0.pre.8
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/lib/praxis/docs/openapi/parameter_object.rb +2 -2
- data/lib/praxis/docs/openapi/paths_object.rb +12 -15
- data/lib/praxis/extensions/pagination/ordering_params.rb +4 -0
- data/lib/praxis/extensions/pagination/pagination_params.rb +4 -0
- data/lib/praxis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa1ee705af72674f99b3b697fe5199636d6268a55696e1bcdf4a892b11b7acf3
|
4
|
+
data.tar.gz: e3cc19834e9640b0ee252240013367b7e444623d19e3acb9cb3eff8c83d71223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 958b4bf7d5684477bfb371e970f8f05871c1699a4980dc508367d5d659dc013ce049b3336d55ca1b4ca1cf617ec5b10924e92e41f18102680087ebf015fe6ce7
|
7
|
+
data.tar.gz: 2bbde613a765af9769b9dba0a13860b4dc520148e4263c5b4b52acf55960f8ba0aa63870f3f31c1ef73a047c33b7ffce30477d789380617f336c0893dedf31a6
|
@@ -48,11 +48,11 @@ module Praxis
|
|
48
48
|
|
49
49
|
if action.params
|
50
50
|
route_params = \
|
51
|
-
|
51
|
+
unless action.route
|
52
52
|
warn "Warning: No routes defined for action #{action.name}"
|
53
53
|
[]
|
54
54
|
else
|
55
|
-
action.
|
55
|
+
action.route.path.named_captures.keys.collect(&:to_sym)
|
56
56
|
end
|
57
57
|
(action.params.attributes||{}).each_with_object(output) do |(name, info), out|
|
58
58
|
in_type = route_params.include?(name) ? :path : :query
|
@@ -31,21 +31,18 @@ module Praxis
|
|
31
31
|
# fill in the paths hash with a key for each path for each action/route
|
32
32
|
resource.actions.each do |action_name, action|
|
33
33
|
params_example = action.params ? action.params.example(nil) : nil
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
action_tags = [resource.display_name]
|
47
|
-
path_entry[verb] = OperationObject.new( id: action_uid, url: url, action: action, tags: action_tags).dump
|
48
|
-
end
|
34
|
+
url = ActionDefinition.url_description(route: action.route, params: action.params, params_example: params_example)
|
35
|
+
|
36
|
+
verb = url[:verb].downcase
|
37
|
+
templetized_path = OpenApiGenerator.templatize_url(url[:path])
|
38
|
+
path_entry = paths[templetized_path]
|
39
|
+
# Let's fill in verb stuff within the working hash
|
40
|
+
raise "VERB #{_verb} already defined for #{id}!?!?!" if path_entry[verb]
|
41
|
+
|
42
|
+
action_uid = "action-#{action_name}-#{id}"
|
43
|
+
# Add a tag matching the resource name (hoping all actions of a resource are grouped)
|
44
|
+
action_tags = [resource.display_name]
|
45
|
+
path_entry[verb] = OperationObject.new( id: action_uid, url: url, action: action, tags: action_tags).dump
|
49
46
|
end
|
50
47
|
# For each path, we can further annotate with
|
51
48
|
# servers
|
data/lib/praxis/version.rb
CHANGED