croods 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/croods/resource/json_schema/definition.rb +15 -9
- data/lib/croods/resource/policy.rb +1 -1
- data/lib/croods/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: 1d384b5ea86ec6b48095b9772afb47414627799144627547722b6322aae58d73
|
4
|
+
data.tar.gz: e58a394c1e3c9bd4b6787c092a09d1bb6582e313151baaedcb9ec0aee8c72735
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 369cc10370be1f7e010d07a858143d929292633752286529b72c7f5558195146a350e5071585adb6a35d6c2edb1bf2a4915ab87f293001fc5669f90a0f46e77c
|
7
|
+
data.tar.gz: ffaec510b409f9cd1d93337aa9939af86d685f4d144cc9e6a06b8fe259a0fabbe1d60fb9628d90ea53ebcf5d313d02d8a3d09b49d548d8aac86abcb56710673b
|
@@ -5,11 +5,12 @@ module Croods
|
|
5
5
|
module JsonSchema
|
6
6
|
module Definition
|
7
7
|
TYPES = {
|
8
|
-
datetime: 'string',
|
9
|
-
date: 'string',
|
10
|
-
text: 'string',
|
11
|
-
json:
|
12
|
-
|
8
|
+
datetime: ['string'],
|
9
|
+
date: ['string'],
|
10
|
+
text: ['string'],
|
11
|
+
json: %w[object array],
|
12
|
+
jsonb: %w[object array],
|
13
|
+
float: ['number']
|
13
14
|
}.freeze
|
14
15
|
|
15
16
|
class << self
|
@@ -30,13 +31,18 @@ module Croods
|
|
30
31
|
|
31
32
|
def types(attribute)
|
32
33
|
types = []
|
33
|
-
|
34
|
-
|
34
|
+
converted_types(attribute.type).each do |converted_type|
|
35
|
+
types << converted_type
|
36
|
+
end
|
37
|
+
null = (
|
38
|
+
attribute.null || attribute.default || attribute.default_function
|
39
|
+
)
|
40
|
+
types << 'null' if null
|
35
41
|
types
|
36
42
|
end
|
37
43
|
|
38
|
-
def
|
39
|
-
TYPES[type] || type.to_s
|
44
|
+
def converted_types(type)
|
45
|
+
TYPES[type] || [type.to_s]
|
40
46
|
end
|
41
47
|
end
|
42
48
|
end
|
data/lib/croods/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: croods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Weinmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: committee
|