JSON Linter By Inventor Commons
What is JSON Linter?
JSON Linter is a validator for JSON, a lightweight data-interchange format. Copy and and paste in the editor above and let JSON Linter validate your JSON code.
Where might JSON be used in Inventor?
JSON is often used in response to network requests sent to external API's such as the groq API we go over here. You may also be using JSON to send data to the API within the response body of a POST request, you can use this tool to check that what you are sending is correct.
Proper JSON Format
Using JSON doesn't require any JavaScript knowledge, though having such would only improve your understanding of JSON. And though the knowledge of JavaScript isn't necessary, following specific rules is:
- Data is in name/value pairs
- Data is separated by commas
- Objects are encapsulated within the opening and closing curly brackets
- An empty object can be represented by
{}
- Arrays are encapsulated within opening and closing square brackets
- An empty array can be represented by
[]
- A member is represented by a key-value pair, contained in double quotes
- Each member should have a unique key within an object structure
- The value of a member must be contained in double quotes, if it's a string
- Boolean values are represented using the
true
orfalse
literals in lower case - Number values are represented using double-precision floating-point format and shouldn't have leading zeroes
- "Offensive" characters in a string need to be escaped using the backslash character
\
- Null values are represented by the
null
literal in lower case - Dates, and similar object types, aren't adequately supported and should be converted to strings
- Each member of an object or array value must be followed by a comma, except for the last one
- The standard extension for the JSON file is
'.json'
- The mime type for JSON files is
'application/json'
You can achieve proper JSON formatting by following these simple rules. However, if you're unsure about your code, we suggest using this tool