apia 3.0.0 → 3.0.2

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: 834322a8dd87426fd34415e096964a331ca3fefd5101e05e23a216da197e1820
4
- data.tar.gz: d422b240f990920a61e520e360d15414aef1b8c0f39021684fa32d31d0aaf1a9
3
+ metadata.gz: 149ff24b39258aecaa9aaf738ff5d65c0d4ef24ccbc74844ae4ae12df5fe3e07
4
+ data.tar.gz: 5c6a4ea4c17f482e6b2614a44aab4e3bf7e9eccae7caacb1acdabe000f7f6838
5
5
  SHA512:
6
- metadata.gz: 6a42e4aaf195d8bd6dc7053a473bbc107ff4303d184bfae3c5bf1e7bb25ef618f57dbc86436c697b06786847f67077d9a06ae9451c6211fbf6072a5cfd6b755e
7
- data.tar.gz: 73762ac070550ec052ffa79f2a5e8fdbb0317b8cdb62020b74d494706a1f2e63a65d52691fed82da4f2ba60ed2d66a2572686d3e0c9fef237ec2632a67bc339b
6
+ metadata.gz: 2b85dd5fea1f2f566e687686883180d73c53f0623598a3552a8f2566ebe6ff0f8987c3446334b2947b83e355466886ffd092b25e132275a1b783c1b2488f0e1e
7
+ data.tar.gz: 7ee2812dc10ac8928bcb9674a18fee6ab6fae117becc9f43a864dc4d35ad7db6bbc95c3ea61d80bcb029e8feb3c463260c012c036d255df8b36205c1ee628831
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.0
1
+ 3.0.2
@@ -34,6 +34,10 @@ module Apia
34
34
  @group.description = description
35
35
  end
36
36
 
37
+ def no_schema
38
+ @group.schema = false
39
+ end
40
+
37
41
  def controller(controller)
38
42
  @group.default_controller = controller
39
43
  end
@@ -1,20 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Apia
4
- class RouteGroup
4
+ class RouteGroup < Definition
5
5
 
6
- attr_reader :id
7
6
  attr_reader :parent
8
- attr_accessor :name
9
- attr_accessor :description
10
7
  attr_accessor :default_controller
11
8
  attr_reader :groups
12
9
 
10
+ # rubocop:disable Lint/MissingSuper
13
11
  def initialize(id, parent)
14
12
  @id = id
15
13
  @parent = parent
16
14
  @groups = []
17
15
  end
16
+ # rubocop:enable Lint/MissingSuper
18
17
 
19
18
  end
20
19
  end
@@ -18,8 +18,10 @@ module Apia
18
18
  end
19
19
  field :endpoints, type: [ControllerEndpointSchemaType] do
20
20
  backend do |c|
21
- c.endpoints.map do |key, endpoint|
22
- {
21
+ c.endpoints.each_with_object([]) do |(key, endpoint), array|
22
+ next unless endpoint.definition.schema?
23
+
24
+ array << {
23
25
  name: key.to_s,
24
26
  endpoint: endpoint.definition.id
25
27
  }
@@ -10,10 +10,15 @@ module Apia
10
10
 
11
11
  field :routes, [RouteSchemaType] do
12
12
  backend do |o|
13
- o.routes.select { |r| r.endpoint&.definition&.schema? }
13
+ o.routes.select { |r| r.group&.schema? && r.endpoint&.definition&.schema? }
14
+ end
15
+ end
16
+
17
+ field :groups, [RouteGroupSchemaType] do
18
+ backend do |o|
19
+ o.groups.select { |g| g.schema? }
14
20
  end
15
21
  end
16
- field :groups, [RouteGroupSchemaType]
17
22
 
18
23
  end
19
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-04 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -164,7 +164,8 @@ files:
164
164
  - lib/apia/schema/scope_type.rb
165
165
  - lib/apia/version.rb
166
166
  homepage: https://github.com/krystal/apia
167
- licenses: []
167
+ licenses:
168
+ - MIT
168
169
  metadata: {}
169
170
  post_install_message:
170
171
  rdoc_options: []