forest_admin_agent 1.12.9 → 1.12.10
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99bc2a5d269ec779d0eada09696e3f344252c8b00be0832b45cfc663512a991c
|
|
4
|
+
data.tar.gz: cecda724ec884d709c423f1b3c294121f5a3d087efcc8d9267b35e045e5b2156
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fe282e62e092163591a1326579142da75c191f4d72a1bb25dbb46335671cf3c5b27f13644170f859ed8d002ed6c04c37dc79d35814573272c314a39fed5cca7
|
|
7
|
+
data.tar.gz: 3142d07f4207ec11701d6892212dab37f1a1b91383d0f8739f07d94969f729697c390b979659685f26a8054733d9ccb0886fd03f2a30dcbb906159298d69bf48
|
|
@@ -86,7 +86,7 @@ module ForestAdminAgent
|
|
|
86
86
|
collections: generated
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
File.write(schema_path,
|
|
89
|
+
File.write(schema_path, format_schema_json(schema))
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
if (append_schema_path = Facades::Container.cache(:append_schema_path))
|
|
@@ -103,6 +103,20 @@ module ForestAdminAgent
|
|
|
103
103
|
|
|
104
104
|
private
|
|
105
105
|
|
|
106
|
+
def format_schema_json(schema)
|
|
107
|
+
# Custom JSON formatting that keeps single-element arrays on one line
|
|
108
|
+
json = JSON.pretty_generate(schema)
|
|
109
|
+
|
|
110
|
+
# Replace multiline arrays containing only ONE string with single-line format
|
|
111
|
+
# This matches patterns like:
|
|
112
|
+
# type: [
|
|
113
|
+
# "String"
|
|
114
|
+
# ]
|
|
115
|
+
# and replaces them with: type: ["String"]
|
|
116
|
+
# Multi-element arrays (like enums) remain on multiple lines for readability
|
|
117
|
+
json.gsub(/:\s*\[\n\s*("(?:[^"\\]|\\.)*")\n\s*\]/, ': [\1]')
|
|
118
|
+
end
|
|
119
|
+
|
|
106
120
|
def post_schema(schema, force)
|
|
107
121
|
api_map = SchemaEmitter.serialize(schema)
|
|
108
122
|
should_send = do_server_want_schema(api_map[:meta][:schemaFileHash])
|
|
@@ -77,7 +77,7 @@ module ForestAdminAgent
|
|
|
77
77
|
|
|
78
78
|
def validate_array_field!(field_schema, field_name)
|
|
79
79
|
FieldValidator.validate(@collection, field_name)
|
|
80
|
-
return if field_schema.column_type.
|
|
80
|
+
return if field_schema.column_type.is_a?(Array)
|
|
81
81
|
|
|
82
82
|
raise Http::Exceptions::ValidationError,
|
|
83
83
|
"Field '#{field_name}' is not an array (type: #{field_schema.column_type})"
|
|
@@ -120,9 +120,9 @@ module ForestAdminAgent
|
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
def coerce_value(value, column_type)
|
|
123
|
-
return value unless column_type.
|
|
123
|
+
return value unless column_type.is_a?(Array)
|
|
124
124
|
|
|
125
|
-
element_type = column_type.
|
|
125
|
+
element_type = column_type.first
|
|
126
126
|
|
|
127
127
|
if element_type == 'Number' && value.is_a?(String)
|
|
128
128
|
begin
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: forest_admin_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.12.
|
|
4
|
+
version: 1.12.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthieu
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2025-10-
|
|
12
|
+
date: 2025-10-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|