How to use the JSON Validator and Formatter.
JSON validation should use a parser and report the actual error location. Formatting is separate from checking an application-specific schema.
Make the workflow fit your task.
Parse the exact input to identify syntax errors, then format valid JSON without changing values. Keep application-schema validation separate and report the location and reason for the actual parser failure.
- What you provide
- JSON text.
- What you get
- Syntax validation, error locations and formatted JSON.
See the input and the result.
Illustrative input and output · a teaching example, not a live WebAct run
Example input
Input: {"active": true,}Completed example
The trailing comma is invalid JSON. Corrected input: {"active": true}.Load this input into the prompt, then copy it to WebAct to try the task. Your result may differ from the illustration.
Decisions and troubleshooting.
Does valid JSON mean the data satisfies my API contract?
No. Syntax validation only establishes that the JSON can be parsed. Required fields, types and business rules need separate checks.
Why does text that looks like a JavaScript object fail JSON parsing?
Check quoted property names, trailing commas and unsupported values or comments. JSON has its own syntax rules.
Try it with your own source.
Replace the example with your material in the task prompt. Keep the requirements you need, then copy the task into WebAct.
Customize and copy the task ↑