blueprinter_schema 0.2.0 → 0.3.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/lib/blueprinter_schema/version.rb +1 -1
- data/lib/blueprinter_schema.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc07f2ba27532688748d728cfdb6ee4ae6d0c92a66b17d753519384ee8538f5b
|
4
|
+
data.tar.gz: 2add634f63f55305245acb2fb7d64438f7017d8ce6bdce9bb7626f59f186b66a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 592881730764b7873f8ae95bc4de43942f3f8345c37327157b528b9b740706544c206b1ea84b3c41d430d8e6f389cd6699cf0a535797c07e4f2e82aa06c8aa33
|
7
|
+
data.tar.gz: 88163ad100fa9e310cb42c8b1dc9240b3aa09831b048e6215ddc6636cfea57ade49d452290ca01cd91a13f001e902fe8291ff17d8da63ad85a32d1abe470e7c4
|
data/lib/blueprinter_schema.rb
CHANGED
@@ -50,6 +50,7 @@ module BlueprinterSchema
|
|
50
50
|
end
|
51
51
|
|
52
52
|
# rubocop:disable Metrics/MethodLength
|
53
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
53
54
|
def ar_column_to_json_schema(column)
|
54
55
|
case column.type
|
55
56
|
when :string, :text
|
@@ -64,12 +65,15 @@ module BlueprinterSchema
|
|
64
65
|
build_json_schema_type('string', column.null, 'date')
|
65
66
|
when :datetime, :timestamp
|
66
67
|
build_json_schema_type('string', column.null, 'date-time')
|
68
|
+
when :uuid
|
69
|
+
build_json_schema_type('string', column.null, 'uuid')
|
67
70
|
else
|
68
71
|
# Unknown column type, we don't know the schema type
|
69
72
|
{}
|
70
73
|
end
|
71
74
|
end
|
72
75
|
# rubocop:enable Metrics/MethodLength
|
76
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
73
77
|
|
74
78
|
def build_json_schema_type(json_schema_type, nullable, format = nil)
|
75
79
|
type = { 'type' => nullable ? [json_schema_type, 'null'] : json_schema_type }
|