foobara-json-schema-generator 1.1.0 → 1.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/CHANGELOG.md +4 -0
- data/src/json_schema_generator.rb +5 -5
- 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: fe982c9eb854665188f26a61de404de190cc917fd91b413c338d428d083426e3
|
|
4
|
+
data.tar.gz: 042aff0322c960a4ba71c001bbb1bd8d2a12873329f2348e261d5d3d6f12e09d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30df660d339042da76dbcd1d3a1b8d698351a770c180a6d9264eff7e228f48d58a7ab08f4a61592cbeeaa901a7f15c0a71c33b1276c26a984eec01ecdcd9f4c2
|
|
7
|
+
data.tar.gz: b48856f56dec9e6db8623149cf627ce8bc03359a7834ee014eae125cbdd9cafc4ae83d2ec42e9ff23417d1079d5e0c127257e61c96edaa25112733ac0676f14f
|
data/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@ module Foobara
|
|
|
4
4
|
def to_json_schema(type, association_depth: Foobara::AssociationDepth::ATOM)
|
|
5
5
|
poro = to_json_schema_structure(type, association_depth:)
|
|
6
6
|
|
|
7
|
-
JSON.
|
|
7
|
+
JSON.generate(poro)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def to_json_schema_structure(type, association_depth: Foobara::AssociationDepth::ATOM)
|
|
@@ -105,16 +105,16 @@ module Foobara
|
|
|
105
105
|
{ type: "number" }
|
|
106
106
|
elsif type.extends?(BuiltinTypes[:associative_array])
|
|
107
107
|
# TODO: implement this
|
|
108
|
-
# :
|
|
108
|
+
# simplecov:disable
|
|
109
109
|
raise ArgumentError, "Associative array not yet supported"
|
|
110
|
-
# :
|
|
110
|
+
# simplecov:enable
|
|
111
111
|
elsif type.extends?(BuiltinTypes[:duck])
|
|
112
112
|
{}
|
|
113
113
|
else
|
|
114
|
-
# :
|
|
114
|
+
# simplecov:disable
|
|
115
115
|
# This should be unreachable because every type extends duck...
|
|
116
116
|
raise ArgumentError, "Unable to convert #{declaration_data} to a JSON schema type"
|
|
117
|
-
# :
|
|
117
|
+
# simplecov:enable
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
unless type.primitive?
|
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.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
65
|
version: '0'
|
|
66
66
|
requirements: []
|
|
67
|
-
rubygems_version:
|
|
67
|
+
rubygems_version: 4.0.16
|
|
68
68
|
specification_version: 4
|
|
69
69
|
summary: Takes a Foobara type and converts it to a json schema
|
|
70
70
|
test_files: []
|