JSON syntax error on API root

Dave Johnson dajohnso at redhat.com
Thu Apr 14 22:30:48 UTC 2011


Hello, 

I found that when I make a request for the API root and pass it into a
JAVA JSONObject, I get a syntax exception.  Digging around on the web I
found this JSON Validator, http://www.jsonlint.com/, and got the same
errors...

syntax error, unexpected '[', expecting TSTRING at line 4
Parsing failed

Basically it doesn't like the first set of curly braces and the
service/version pairs on the API ROOT.  Requests to buckets or keys work
great.  If I remove offending lines and take everything inside the
brackets, it passes.  

So is this expected?  It seems like a issue to me but it is also
deliberate so just curious on what I am missing?  :)

Thanks,
-Dave Johnson


Sample response snippet that fails syntax
==========================================
{
	"service": "image_warehouse",
	"version": "0.92",
	[
		{
			"rel": "bucket_factory",
			"link": "http://127.0.0.1:9090/_new"
		},
		{
			"rel": "provider_list",
			"link": "http://127.0.0.1:9090/_providers"
		},
	]
}


valid json snippet
==================================
	[
		{
			"rel": "bucket_factory",
			"link": "http://127.0.0.1:9090/_new"
		},
		{
			"rel": "provider_list",
			"link": "http://127.0.0.1:9090/_providers"
		},
	]



More information about the iwhd-devel mailing list