|
|
@@ -40,6 +40,12 @@ export const jsonStringValueTransformer: ValueTransformer = {
|
|
|
return value;
|
|
|
}
|
|
|
|
|
|
+ // For scalar string fields, return the raw value without JSON parsing.
|
|
|
+ // This prevents issues like "0" being parsed as number 0, or "-0" becoming -0 which is "0" in the input.
|
|
|
+ if (fieldDef.type === 'string' && !fieldDef.list) {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
// For JSON string mode, parse the string to get the native value
|
|
|
const parsed = JSON.parse(value);
|