finitio 0.11.2 → 0.11.3

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
  SHA1:
3
- metadata.gz: 1b4bcc2dab9afa958c597af1418553f339b726fb
4
- data.tar.gz: 3140214a73d11d6733e770d9ca2950dae0c34650
3
+ metadata.gz: acf74d5293b979c7c03d55dc9cbea273b9f85d6c
4
+ data.tar.gz: 14e18b10f4668fc996354ec2ceb6627eb56dffbc
5
5
  SHA512:
6
- metadata.gz: 18ce81cd1bd6014172453ac187e0f2e78d3f6f8729f02e1e7875fdb06c324e926a660b3af25b8cea7e224dfbc3a2b45146106533ccb49f09627822ca595e4313
7
- data.tar.gz: 76ef53792f483628ce1e9c786d99d324235a244da6696d05105666d2578859368de020104f7da4a1ee096b5d2d4b7c98ae87408bbac6042f7e74e891809ea650
6
+ metadata.gz: ba3a092904c8ac102361ef17b2fc0f49d8f6ed209d2a3ffe0ec852f3c3b52772716762bf65d3604831a631f2ecc8782cdaa120b7768608849ec72bdbc164f8d2
7
+ data.tar.gz: a33d566ed9e25caed8b90d7228583056152ee1fb0c50533fad4008ab72d318fd3d51430f1f50146f42c77104f6fad40c86591200e168cce14de05d46995e228d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.11.3 - 2023/01/06
2
+
3
+ * Fix json_schema generation on unresolved ProxyTypes. We use
4
+ "object" by default, waiting for a better support for recursive
5
+ types.
6
+
1
7
  # 0.11.2 - 2023/01/06
2
8
 
3
9
  * Fix json_schema generation on builtin_type NilClass. "null"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- finitio (0.11.2)
4
+ finitio (0.11.3)
5
5
  citrus (>= 3.0, < 4.0)
6
6
 
7
7
  GEM
@@ -2,7 +2,11 @@ module Finitio
2
2
  class ProxyType
3
3
 
4
4
  def to_json_schema(*args, &bl)
5
- @target.to_json_schema(*args, &bl) if @target
5
+ if @target
6
+ @target.to_json_schema(*args, &bl)
7
+ else
8
+ "object"
9
+ end
6
10
  end
7
11
 
8
12
  end # module ProxyType
@@ -3,7 +3,7 @@ module Finitio
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 11
6
- TINY = 2
6
+ TINY = 3
7
7
 
8
8
  def self.to_s
9
9
  [ MAJOR, MINOR, TINY ].join('.')
@@ -0,0 +1,48 @@
1
+ require 'spec_helper'
2
+ module Finitio
3
+ module JsonSchema
4
+ describe "A recursive type" do
5
+
6
+ let(:system){
7
+ ::Finitio.system <<-FIO
8
+ Tree = {
9
+ children : [Tree]
10
+ }
11
+ FIO
12
+ }
13
+
14
+ let(:type) {
15
+ system['Tree']
16
+ }
17
+
18
+ xit 'works as expected' do
19
+ expect(type.to_json_schema).to eql({
20
+ type: "object",
21
+ properties: {
22
+ children: {
23
+ type: "array",
24
+ items: {
25
+ type: "object",
26
+ properties: {
27
+ children: {
28
+ type: "array",
29
+ items: "object"
30
+ }
31
+ },
32
+ required: [
33
+ :children
34
+ ],
35
+ additionalProperties: false
36
+ }
37
+ }
38
+ },
39
+ required: [
40
+ :children
41
+ ],
42
+ additionalProperties: false
43
+ })
44
+ end
45
+
46
+ end
47
+ end
48
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
@@ -309,6 +309,7 @@ files:
309
309
  - spec/json_schema/test_builtin_type.rb
310
310
  - spec/json_schema/test_multi_relation_type.rb
311
311
  - spec/json_schema/test_multi_tuple_type.rb
312
+ - spec/json_schema/test_recursive_type.rb
312
313
  - spec/json_schema/test_relation_type.rb
313
314
  - spec/json_schema/test_seq_type.rb
314
315
  - spec/json_schema/test_set_type.rb
@@ -616,6 +617,7 @@ test_files:
616
617
  - spec/json_schema/test_ad_type.rb
617
618
  - spec/json_schema/test_builtin_type.rb
618
619
  - spec/json_schema/test_multi_relation_type.rb
620
+ - spec/json_schema/test_recursive_type.rb
619
621
  - spec/json_schema/test_sub_type.rb
620
622
  - spec/json_schema/test_any_type.rb
621
623
  - spec/json_schema/test_seq_type.rb