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: 98c689bf74a3f3bf3dd9cab8747d0e0a526b8b7a1e7de3d43133312cf269b755
4
- data.tar.gz: 6ef3e6ed4018298169d19d9eac6d6e4767695ebe372839319753d967e8c48471
3
+ metadata.gz: 99bc2a5d269ec779d0eada09696e3f344252c8b00be0832b45cfc663512a991c
4
+ data.tar.gz: cecda724ec884d709c423f1b3c294121f5a3d087efcc8d9267b35e045e5b2156
5
5
  SHA512:
6
- metadata.gz: 5eb4c1f3f0cc477a2debc4191d18f191454afb628b15130b9365d1aaef78f88d5a1721ffc3fb17e3b3980a2e7c9f8b8dc3f54626f9130092ae09c142379d3aa6
7
- data.tar.gz: 8c9cf757c454036b80b70ef7e1e7aa2646e2c6abd172f09a1a569ea81cff3200e7010f200afb55d600a75a8e1be9a828fc27baff52e4d77af6e1fa58a348dddb
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, JSON.pretty_generate(schema))
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.to_s.start_with?('[')
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.to_s.start_with?('[') && column_type.to_s.end_with?(']')
123
+ return value unless column_type.is_a?(Array)
124
124
 
125
- element_type = column_type.to_s[1..-2]
125
+ element_type = column_type.first
126
126
 
127
127
  if element_type == 'Number' && value.is_a?(String)
128
128
  begin
@@ -6,7 +6,7 @@ module ForestAdminAgent
6
6
  module Schema
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
- LIANA_VERSION = "1.12.9"
9
+ LIANA_VERSION = "1.12.10"
10
10
 
11
11
  def self.generate(datasource)
12
12
  datasource.collections
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.12.9"
2
+ VERSION = "1.12.10"
3
3
  end
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.9
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-27 00:00:00.000000000 Z
12
+ date: 2025-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport