foobara-json-schema-generator 0.0.6 → 1.0.0

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: 0aef2e8bba777720358599aeea52118bef2ef4374c2e86b47af6cdd66311103f
4
- data.tar.gz: 8108afa702a8b91dd66f7717cd0948dc4fa23a85164a3b01ef5547a9191509ba
3
+ metadata.gz: 7496c412ff45f1dc6db1b129995b127be3b1b5008b4df3d4c2bb1b9c43b966b2
4
+ data.tar.gz: b89116242f86ca0d282eda61a9ca9def2f3f1c16bf34413c40686d3dcd111544
5
5
  SHA512:
6
- metadata.gz: 4adc77ee8839324271a8e32a437bc61e958959beaa3bfd4458d26ed528383cbfa1da9d5ec0d51af75df0c82ccab0663b247f25c1e598b92d47f9adfe70a810e4
7
- data.tar.gz: b58482bea53277e6637c355a0eea32c69e7a34170ee2a45254f1709b8bccfbcaa5ce603dfa5813d0f2a1ba8cf78f63272745c13b7e88f0050af8db753beab36f
6
+ metadata.gz: 254bb5befa15e14b7dfff067cb20a547a907820ce5b20f4de41c6777a2a312ce9ac2198ed47c6f57334eded62aff966c5b373700dad16204fc19b37fc64ae1d2
7
+ data.tar.gz: ef69c5d5a90cfba4f0f2a28f36dcc8a72d8035c754bb7fad8def4988d87a3b24d0f51055f19f33f7ae2ab73425c5b9ef784ed3c5610042e35c8b69ee2c16d4ac
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.0] - 2025-07-08
2
+
3
+ - Fix bug resulting in incorrect description when converting entity to primary key
4
+
1
5
  ## [0.0.6] - 2025-06-19
2
6
 
3
7
  - Improve the description on entity types converted to primary key types
@@ -1,15 +1,13 @@
1
- require_relative "association_depth"
2
-
3
1
  module Foobara
4
2
  module JsonSchemaGenerator
5
3
  class << self
6
- def to_json_schema(type, association_depth: AssociationDepth::ATOM)
4
+ def to_json_schema(type, association_depth: Foobara::AssociationDepth::ATOM)
7
5
  poro = to_json_schema_structure(type, association_depth:)
8
6
 
9
7
  JSON.fast_generate(poro)
10
8
  end
11
9
 
12
- def to_json_schema_structure(type, association_depth: AssociationDepth::ATOM)
10
+ def to_json_schema_structure(type, association_depth: Foobara::AssociationDepth::ATOM)
13
11
  foobara_type_to_json_schema_type_poro(type, association_depth:)
14
12
  end
15
13
 
@@ -23,12 +21,10 @@ module Foobara
23
21
 
24
22
  if association_depth == AssociationDepth::PRIMARY_KEY_ONLY ||
25
23
  (association_depth == AssociationDepth::ATOM && within_entity)
26
- description = unless type.extends_directly?(:entity)
27
- [
28
- "#{target_class.model_name} #{target_class.primary_key_attribute}",
29
- type.description
30
- ].join(" : ")
31
- end
24
+ description = [
25
+ "#{target_class.model_name} #{target_class.primary_key_attribute}",
26
+ *type.description
27
+ ].join(" : ")
32
28
 
33
29
  foobara_type_to_json_schema_type_poro(
34
30
  target_class.primary_key_type,
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: 0.0.6
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -35,7 +35,6 @@ files:
35
35
  - LICENSE.txt
36
36
  - README.md
37
37
  - lib/foobara/json_schema_generator.rb
38
- - src/association_depth.rb
39
38
  - src/json_schema_generator.rb
40
39
  homepage: https://github.com/foobara/json-schema-generator
41
40
  licenses:
@@ -1,9 +0,0 @@
1
- module Foobara
2
- module JsonSchemaGenerator
3
- module AssociationDepth
4
- PRIMARY_KEY_ONLY = :primary_key_only
5
- ATOM = :atom
6
- AGGREGATE = :aggregate
7
- end
8
- end
9
- end