View Single Post
Old 04-09-2013, 12:03 PM   #699
stepk
Groupie
stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.stepk ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 593460
Join Date: Oct 2012
Device: K5 B011 5.3.2.1
Quote:
Originally Posted by twobob View Post
Okay. I found it.

Code:
{
"items": [
		{
			"name": "Testy",
			"priority": 1,
			"items": [
		{"name": "FOO RUNNER", "priority": 1, "action": "bin/foo.sh"},
		{"name": "BAH RUNNER", "priority": 2, "action": "bin/bah.sh"},
		{"name": "FUBARRED", "priority": 3, "action": "bin/fubar.sh"}			
			]
		}
	]
}
WILL Work.


Code:
{
"items": [
		{"name": "FOO RUNNER", "priority": 1, "action": "bin/foo.sh"},
		{"name": "BAH RUNNER", "priority": 2, "action": "bin/bah.sh"},
		{"name": "FUBARRED", "priority": 3, "action": "bin/fubar.sh"}}			
	]
}
Won't work.

It's related to the formatting of the menu.json...
Reproducible in all instances.
The second JSON sample is invalid. This is what I get, you should see the same, don't you?
Code:
{
"items": [
		{"name": "FOO RUNNER", "priority": 1, "action": "bin/foo.sh"},
		{"name": "BAH RUNNER", "priority": 2, "action": "bin/bah.sh"},
		{"name": "FUBARRED", "priority": 3, "action": "bin/fubar.sh"}}	
	]
}

.../menu.json: expected <, or ]> but got <}> at input token 46

KUAL( 1 ) ▶
  .Syntax .../menu.json      <<< [more info in KUAL log]
  Save and reset KUAL log
  Sort Menu 123
  × Quit
EDIT: I see now that you've already discovered the extra brace issue. Well, then my reply simply illustrates that the new parser catches and doesn't ignore invalid JSON - the former parser was more graceful and ignored bad syntax. I chose for the new parser not to be lenient.

Last edited by stepk; 04-09-2013 at 12:07 PM.
stepk is offline   Reply With Quote