foobara-json-schema-generator 1.0.0 → 1.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7496c412ff45f1dc6db1b129995b127be3b1b5008b4df3d4c2bb1b9c43b966b2
4
- data.tar.gz: b89116242f86ca0d282eda61a9ca9def2f3f1c16bf34413c40686d3dcd111544
3
+ metadata.gz: 941cc81aba10dd18bb19c8b8427033e76247b4487e827aba21c77c71b5b5ed79
4
+ data.tar.gz: 30d402402fe3ba09559aebfc141f6b770afd7c944a895cb9e6c1ce7b01dc7859
5
5
  SHA512:
6
- metadata.gz: 254bb5befa15e14b7dfff067cb20a547a907820ce5b20f4de41c6777a2a312ce9ac2198ed47c6f57334eded62aff966c5b373700dad16204fc19b37fc64ae1d2
7
- data.tar.gz: ef69c5d5a90cfba4f0f2a28f36dcc8a72d8035c754bb7fad8def4988d87a3b24d0f51055f19f33f7ae2ab73425c5b9ef784ed3c5610042e35c8b69ee2c16d4ac
6
+ metadata.gz: 8687222ac9cd86b7792aff4b6a2604172ba1c191e81fc0c88a487685cb016b2e73150bb5b5387e2f8aa77b7dab45f3ffaef63d1bba646851ec426f4e5581209e
7
+ data.tar.gz: 4921a18e39e14b4dd9e5ae3fb41af9cc6eee0e045da79ff836e5b452e9c9b7131d7b30020d35fecd668c84c43bcc499726da48044d814cbcb88d1e634a59bd41
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.1] - 2025-07-12
2
+
3
+ - Add support for tuples
4
+
1
5
  ## [1.0.0] - 2025-07-08
2
6
 
3
7
  - Fix bug resulting in incorrect description when converting entity to primary key
@@ -41,10 +41,25 @@ module Foobara
41
41
  foobara_type_to_json_schema_type_poro(type.target_class.attributes_type, association_depth:,
42
42
  within_entity:)
43
43
  elsif type.extends?(BuiltinTypes[:tuple])
44
- # TODO: implement this logic for tuple
45
- # :nocov:
46
- raise ArgumentError, "Tuple not yet supported"
47
- # :nocov:
44
+ element_types = type.element_types
45
+ size = element_types.size
46
+ items = element_types.map do |element_type|
47
+ foobara_type_to_json_schema_type_poro(element_type, association_depth:, within_entity:)
48
+ end
49
+
50
+ uniq_items = items.uniq
51
+
52
+ if uniq_items.size == 1
53
+ items = uniq_items.first
54
+ end
55
+
56
+ {
57
+ type: "array",
58
+ additionalItems: false,
59
+ minItems: size,
60
+ maxItems: size,
61
+ items:
62
+ }
48
63
  elsif type.extends?(BuiltinTypes[:array])
49
64
  items = if type.element_type
50
65
  foobara_type_to_json_schema_type_poro(type.element_type, association_depth:,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-json-schema-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -13,16 +13,22 @@ dependencies:
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.0.92
18
+ version: 0.0.136
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.0.136
29
+ - - "<"
24
30
  - !ruby/object:Gem::Version
25
- version: 0.0.92
31
+ version: 2.0.0
26
32
  email:
27
33
  - azimux@gmail.com
28
34
  executables: []