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 +4 -4
- data/CHANGELOG.md +4 -0
- data/src/json_schema_generator.rb +6 -10
- metadata +1 -2
- data/src/association_depth.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7496c412ff45f1dc6db1b129995b127be3b1b5008b4df3d4c2bb1b9c43b966b2
|
4
|
+
data.tar.gz: b89116242f86ca0d282eda61a9ca9def2f3f1c16bf34413c40686d3dcd111544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254bb5befa15e14b7dfff067cb20a547a907820ce5b20f4de41c6777a2a312ce9ac2198ed47c6f57334eded62aff966c5b373700dad16204fc19b37fc64ae1d2
|
7
|
+
data.tar.gz: ef69c5d5a90cfba4f0f2a28f36dcc8a72d8035c754bb7fad8def4988d87a3b24d0f51055f19f33f7ae2ab73425c5b9ef784ed3c5610042e35c8b69ee2c16d4ac
|
data/CHANGELOG.md
CHANGED
@@ -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 =
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
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:
|