How to validate the JSON API format


#1

I need to know if the following JSON is a valid JSON API format:

{
“labels” : [ “BANNABLE”, “MIN-BAR”, “Malware”, “Risky” ]
}

Is there any online validator? Can the people in this group validate please?


#2

I think you can validate your snippet with a regular JSON validator like this one http://jsonlint.com/


#3

Hi,

If that is your full request/sesponse body, then no, it’s not valid JSON API. In JSON API, all data must be under aa top-level data key (or a meta key for metadata).

There is a JSON Schema document for the JSON API spec, which (with a few small caveats) can be used to validate whether any JSON document is valid JSON API. Just put your document and that schema into a JSON Schema validator, like this one, and it should tell you if your document is valid.


#4

Use this tool: JSON Formatter https://jsonformatter-online.com