schema_builder 0.1.0 → 0.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/schema_builder/{builder.rb → schema_builder.rb} +8 -8
- data/lib/schema_builder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d35a3bd716fe257bfbc22fd93a175e55930205ed0fec9b0f0856621a0c72ac0
|
4
|
+
data.tar.gz: 9d875d6e74ba351225996b581b170d09f17a08443441cff1df0e190f0d802ff1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a5121903a756577a8fdc7665d9f789bb036806025b3da767b0f2489dc520580bf58ce2c6a9e990bcc233b8a593299576ae5662d38663699a9205674e5b05452
|
7
|
+
data.tar.gz: aba2add0c9a105efc88d25df747a16ba56f453bf6bfe46a7d2a6cf825b1237ac16401ae990ddfbf76a2a92c287fa44eaa3ef21ef6c5dc6f849844fe82b340808
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# json_schema.rb
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
# Define the
|
5
|
-
class
|
4
|
+
# Define the SchemaBuilder class
|
5
|
+
class SchemaBuilder
|
6
6
|
# Initialize the class with the object and included fields
|
7
7
|
def initialize(object, included)
|
8
8
|
@object = object
|
@@ -36,7 +36,7 @@ class JSONSchema
|
|
36
36
|
included_object = @included[item[:type]][item[:id]]
|
37
37
|
|
38
38
|
# Generate a schema for the included object
|
39
|
-
|
39
|
+
SchemaBuilder.new(included_object, @included).generate
|
40
40
|
end
|
41
41
|
else
|
42
42
|
# Nested object - generate a schema for it
|
@@ -44,7 +44,7 @@ class JSONSchema
|
|
44
44
|
included_object = @included[value[:data][:type]][value[:data][:id]]
|
45
45
|
|
46
46
|
# Generate a schema for the included object
|
47
|
-
schema[:properties][property][:properties] =
|
47
|
+
schema[:properties][property][:properties] = SchemaBuilder.new(included_object, @included).generate
|
48
48
|
end
|
49
49
|
|
50
50
|
# Return the generated schema
|
@@ -53,8 +53,8 @@ class JSONSchema
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
# # Define the
|
57
|
-
# module
|
56
|
+
# # Define the SchemaBuilder gem module
|
57
|
+
# module SchemaBuilder
|
58
58
|
# # Define the gem version
|
59
59
|
# VERSION = '1.0.0'
|
60
60
|
|
@@ -64,8 +64,8 @@ end
|
|
64
64
|
# # Define the gem lib directory
|
65
65
|
# LIB_DIR = File.join(ROOT_DIR, 'lib')
|
66
66
|
|
67
|
-
# # Load the
|
68
|
-
# autoload :
|
67
|
+
# # Load the SchemaBuilder class
|
68
|
+
# autoload :SchemaBuilder, File.join(LIB_DIR, 'json_schema')
|
69
69
|
|
70
70
|
# # Define the gem bin directory
|
71
71
|
# BIN_DIR = File.join(ROOT_DIR, 'bin')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arikarim
|
@@ -41,7 +41,7 @@ files:
|
|
41
41
|
- README.md
|
42
42
|
- Rakefile
|
43
43
|
- lib/schema_builder.rb
|
44
|
-
- lib/schema_builder/
|
44
|
+
- lib/schema_builder/schema_builder.rb
|
45
45
|
- lib/schema_builder/version.rb
|
46
46
|
- schema_builder.gemspec
|
47
47
|
- sig/schema_builder.rbs
|