We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e9bde2 commit 61ea78aCopy full SHA for 61ea78a
src/context/RequestContext.tsx
@@ -63,10 +63,13 @@ export const RequestProvider = ({ children }: { children: ReactNode }) => {
63
64
const formatJson = () => {
65
try {
66
- const parsed = JSON.parse(payload);
+ const sanitized = payload.replace(/[“”]/g, '"').replace(/[‘’]/g, "'");
67
+
68
+ const parsed = JSON.parse(sanitized);
69
setPayload(JSON.stringify(parsed, null, 2));
70
} catch (error) {
71
console.error("Invalid JSON");
72
+ alert("Invalid JSON format. Please correct it before formatting.");
73
}
74
};
75
0 commit comments