praxis 2.0.pre.7 → 2.0.pre.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1854f289afef574a8f46cc2e98ab1426a39cf908f1a761b3b294b044b3ea1093
4
- data.tar.gz: 70dfe074269ea807771f891958096b66ea4d2a2a5fa399722527a7114867ac79
3
+ metadata.gz: fa1ee705af72674f99b3b697fe5199636d6268a55696e1bcdf4a892b11b7acf3
4
+ data.tar.gz: e3cc19834e9640b0ee252240013367b7e444623d19e3acb9cb3eff8c83d71223
5
5
  SHA512:
6
- metadata.gz: 6d135d076923a6564b1c7b956a9ad069951d9033b6450eb135772dc7f03a9e1cf36edc0e650a9970694dcb707164326d646c638f917bd5bd55cff51f3a5b0c0c
7
- data.tar.gz: e6c6f36d894f2ff67d85d56073bc54f68d4450a757870c04aecae7d8f33daddd1bdadf2142e36407d12be85e718675624d1229776759277f196f462e574f14b7
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
- if action.primary_route.nil?
51
+ unless action.route
52
52
  warn "Warning: No routes defined for action #{action.name}"
53
53
  []
54
54
  else
55
- action.primary_route.path.named_captures.keys.collect(&:to_sym)
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
- urls = action.route.collect do |route|
35
- ActionDefinition.url_description(route: route, params: action.params, params_example: params_example)
36
- end.compact
37
- urls.each do |url|
38
- verb = url[:verb].downcase
39
- templetized_path = OpenApiGenerator.templatize_url(url[:path])
40
- path_entry = paths[templetized_path]
41
- # Let's fill in verb stuff within the working hash
42
- raise "VERB #{_verb} already defined for #{id}!?!?!" if path_entry[verb]
43
-
44
- action_uid = "action-#{action_name}-#{id}"
45
- # Add a tag matching the resource name (hoping all actions of a resource are grouped)
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
@@ -88,6 +88,10 @@ module Praxis
88
88
 
89
89
  attr_reader :items
90
90
 
91
+ def self.json_schema_type
92
+ :string
93
+ end
94
+
91
95
  def self.native_type
92
96
  self
93
97
  end
@@ -175,6 +175,10 @@ module Praxis
175
175
  end
176
176
  end
177
177
 
178
+ def self.json_schema_type
179
+ :string
180
+ end
181
+
178
182
  def self.native_type
179
183
  self
180
184
  end
@@ -1,3 +1,3 @@
1
1
  module Praxis
2
- VERSION = '2.0.pre.7'
2
+ VERSION = '2.0.pre.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: praxis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.pre.7
4
+ version: 2.0.pre.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep M. Blanquer