You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Malformed .forestadmin-schema.json because it try to espace backslash from schema.rb
Failure Logs
This come from my Production server when I try to deploy ForestAdmin for the first time.
2023-05-25 15:03:33.923134771 +0200 CEST [postdeploy-8568] [2023-05-25 13:03:33] Forest 🌳🌳🌳 The content of .forestadmin-schema.json file is not a correct JSON. 2023-05-25 15:03:33.923138396 +0200 CEST [postdeploy-8568] [2023-05-25 13:03:33] Forest 🌳🌳🌳 The schema cannot be synchronized with Forest Admin servers. 2023-05-25 15:03:33.947271238 +0200 CEST [postdeploy-8568] /app/vendor/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:228:in block in tsort_each'
2023-05-25 15:03:33.947272161 +0200 CEST [postdeploy-8568] /app/vendor/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:431:in each_strongly_connected_component_from'
Context
In my project I have a jsonb column with a default value at database level, this default value include a backslash followed by a double quote, it look like this : t.jsonb "quote_char", default: [{"value"=>"\""}], null: false
Package Version: 8.0.8
Rails Version: 6.1
Database Dialect: SQL
Database Version: PostgreSQL 13
The text was updated successfully, but these errors were encountered:
FYI, I'd monkey patch your lib this way to make things work on our project :
# frozen_string_literal: truemoduleForestLiana# This class is used as a file generator for the ForestLiana gem.classSchemaFileUpdaterdefperformFile.open(@filename,'w')do |file|
# NOTICE: Escape '\' characters to ensure the generation of valid JSON files. It fixes# potential issues if some fields have validations using complex regexp.file.putspretty_print({# rubocop:disable Rails/Outputcollections: @collections,meta: @meta}).gsub(/[^\\](\\)[^\\"]/){ |x| x.gsub(Regexp.last_match(1),'\\\\\\')}.gsub(/("\\\\")/,'"\\\\\\\\\"')endendendend
Expected behavior
Wellformed
.forestadmin-schema.json
Actual behavior
Malformed
.forestadmin-schema.json
because it try to espace backslash fromschema.rb
Failure Logs
This come from my Production server when I try to deploy ForestAdmin for the first time.
2023-05-25 15:03:33.923134771 +0200 CEST [postdeploy-8568] [2023-05-25 13:03:33] Forest 🌳🌳🌳 The content of .forestadmin-schema.json file is not a correct JSON. 2023-05-25 15:03:33.923138396 +0200 CEST [postdeploy-8568] [2023-05-25 13:03:33] Forest 🌳🌳🌳 The schema cannot be synchronized with Forest Admin servers. 2023-05-25 15:03:33.947271238 +0200 CEST [postdeploy-8568] /app/vendor/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:228:in
block in tsort_each'2023-05-25 15:03:33.947272161 +0200 CEST [postdeploy-8568] /app/vendor/ruby-2.7.7/lib/ruby/2.7.0/tsort.rb:431:in
each_strongly_connected_component_from'
Context
In my project I have a
jsonb
column with a default value at database level, this default value include a backslash followed by a double quote, it look like this :t.jsonb "quote_char", default: [{"value"=>"\""}], null: false
The text was updated successfully, but these errors were encountered: