babl-json 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/babl/schema/any_of.rb +6 -1
- data/lib/babl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01613db4c4f669f2f64a0bdbc324bfe38074b44
|
4
|
+
data.tar.gz: 62b10c1b72ad3f2773f3e655099d90453d3f6b1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ca13bb367880694af386e52197753e1e4a1a85aa624bc59c05af691fe98227e840ea5c54e0124eb5401988aa01393657c90c92abd278c3230664046ff638406
|
7
|
+
data.tar.gz: bcbecaa3869e2c8f2c04c4fc565eef473ae5219a39d92c2d6c5dd950eaeaba2d03f66017df98859ecef1ee48e6da9ff919452a76965644ddad32324035553960
|
data/lib/babl/schema/any_of.rb
CHANGED
@@ -12,7 +12,12 @@ module Babl
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def json
|
15
|
-
|
15
|
+
primitives, complex = choice_set.partition { |choice| Primitive === choice }
|
16
|
+
|
17
|
+
simple_enum = { enum: primitives.map(&:value) }
|
18
|
+
return simple_enum if complex.empty?
|
19
|
+
|
20
|
+
{ anyOf: complex.map(&:json) + (primitives.empty? ? [] : [simple_enum]) }
|
16
21
|
end
|
17
22
|
|
18
23
|
# Perform simple transformations in order to reduce the size of the generated
|
data/lib/babl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babl-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederic Terrazzoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coveralls
|