Skip to content

Archive Trac demo app json2

madscatt edited this page Jun 20, 2026 · 1 revision

Demo App JSON2

Legacy Trac archive page imported from demo_app_json2. Source: https://genapp.rocks/wiki/wiki/demo_app_json2. Review age, links, and examples before treating as current.

3. Demo GenApp Application

c. GenApp JSON Definitions

JSON format & Examples

{
    "name"        : "value",
    "othername"   : "othervalue",
    "almostpi"    : 3.14159
}
- **Example 2:** the *"value"* is an array
{
    "vectorname" : [ 1, 2, 4, "five"]
}
- **Example 3:** the *"value"* is arbitrarily nested
{
    "arbitrarily-nested" :
		[{ "this" : [ 1, 2, 4,"five"] },
  	      "that" ]
}
  • Here are some JSON snippets from different definitions of the actual Demo application:
    • from {{{demo/menu.json}}}: it defines Demo's module "Energy"
{
    "modules" : [ 
                     { 
                        "id"    : "penergy",
                        "label" : "Energy"
                      }
                 ]
}
- from {{{demo/modules/penery.json}}}: defines GUI output field labeled "Energy [J]" (can be seen on the right picture [here](Tutorial-Demo-App))
{
      "role"       : "output"
      ,"id"         : "e"
      ,"label"     : "Energy [J]"
      ,"type"      : "text"
}
  • Notes on syntax:
    • Trailing commas are not generally allowed
    • Use {{{check_json.pl 'filename'}}} from command line to verify syntax after editing (it's in your path)
    • We allow comments beginning a line with {{{#}}} in all JSON files except {{{appconfig.json}}}

Previous | Up | Next

Clone this wiki locally