fix: JSON validation accepts @placeholders@ as valid values

This commit is contained in:
sokol
2026-02-18 22:14:36 +03:00
parent 88984a21b2
commit 18193b71c1

View File

@@ -51,7 +51,9 @@ export function ConfigTemplate(props: ConfigTemplateProps) {
// Validate JSON on every change // Validate JSON on every change
try { try {
if (value.trim()) { if (value.trim()) {
JSON.parse(value); // Replace @placeholders@ with valid JSON values for validation
const sanitizedValue = value.replace(/"@?(\w+)@?"/g, '"__PLACEHOLDER__"');
JSON.parse(sanitizedValue);
setJsonError(null); setJsonError(null);
} else { } else {
setJsonError(null); setJsonError(null);