JSON में गलतियाँ कैसे खोजें
- पेस्ट करें
- जाँचें
- ठीक करें
You wrote JSON, and the program couldn't read it and gave an error. You can't tell what's wrong. Format and Validate JSON checks whether the pasted JSON is correct.
चरण
- Paste the JSON into "Before".
- Press "Format".
- If correct, "Valid JSON" is shown and the tidy result appears under "After".
- If there is an error, "The JSON is malformed" is shown.
Flow of checking
- Check whether the pasted JSON is correct.
- If there is an error, fix it.
- Check again with "Format".
- If "Valid JSON" appears, the syntax is right.
Tips for finding errors
- Shorten and try: paste just part of the JSON and look for where the error starts.
- Check bracket pairing: do the numbers of { and }, [ and ] match?
- Check commas: present between items, and no extra after the last item?
- Check quotes: are item names and strings enclosed in double quotes (")?
Examples judged correct
Item names enclosed in double quotes, and values that are a string, number, boolean, null, array or object.
Even correct JSON needs care
Even if "Valid JSON" appears, it doesn't necessarily match the items and form the program expects. Check the spelling of item names and value types separately.
इनके लिए अच्छा
- Checking after editing a configuration file
- Checking hand-written JSON
- Checking before sending to an API
- Checking that copied JSON isn't truncated
उदाहरण
After hand-editing a configuration file, the app wouldn't start. Pasting it in showed "The JSON is malformed". Deleting an extra comma after the last item fixed it.
Common stumbling blocks
- Can't tell where the error is: shorten and try.
- Full-width symbols included: full-width brackets and quotes can't be used.
Frequently asked questions
Can JSON5 or JSON with comments be checked?
It is judged by the rules of ordinary JSON. Comments can't be written.
सारांश
Just paste and press "Format" to check the syntax. Look for errors starting with the common mistakes.
“JSON फ़ॉर्मैट और वैलिडेट करें” इस्तेमाल करें (मुफ़्त)इसके साथ काम आने वाले टूल
- CSV और JSON बदलें: CSV और JSON के बीच तुरंत बदलें।
- फ़ाइलें और Base64 बदलें: फ़ाइलों और Base64 टेक्स्ट के बीच बदलें।
- दोहराई पंक्तियाँ हटाएँ और सूची को क्रम में लगाएँ: दोहराई गई पंक्तियाँ हटाएँ और उन्हें क्रम में लगाएँ।
अगर यह गाइड काम आया हो, तो एक छोटी टिप हमारे लिए बहुत मायने रखेगी।
टिप भेजें (¥300)उपहार भेजें (Amazon विशलिस्ट)