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
But I can't figure out why the first \ is escaped and not the second one.
Failure Logs
When we start the app containing the forest-sequelize middleware in production mode, we can see the log below: The content of .forestadmin-schema.json file is not a correct JSON.
Context
Create a project with forest-express-sequelize middleware
Create in this project a sequelize model that contains a field validated with a regex containing at least one \.
Start the project in production mode
The generated .forestadmin-schema.json file is broken.
Package Version: 3.3.0
Express Version: 4.17.1
Sequelize Version: 5.10.1
Database Dialect: pg
Database Version: 11
The text was updated successfully, but these errors were encountered:
Expected behavior
The validation decorator parser should escape the regex correctly in order to not break the
.forestadmin-schema.json file
Actual behavior
When a validation regex applied on a field model contains a
\
character, for instance:The generated .forestadmin-schema.json file is broken because of the string is not correctly escaped:
Here, only the first
\
is escaped, not the second one.I take a look in the code and I found this:
forest-express-sequelize/src/services/apimap-field-builder.js
Line 96 in cd7059e
But I can't figure out why the first
\
is escaped and not the second one.Failure Logs
When we start the app containing the forest-sequelize middleware in production mode, we can see the log below:
The content of .forestadmin-schema.json file is not a correct JSON.
Context
Create a project with
forest-express-sequelize
middlewareCreate in this project a sequelize model that contains a field validated with a regex containing at least one
\
.Start the project in production mode
The generated .forestadmin-schema.json file is broken.
The text was updated successfully, but these errors were encountered: