Skip to main content


Laurence MorganAbout 2 min


Murex-flavoured JSON (deprecated)


This format has been deprecated in favour of %{} constructors.

mxjson is an extension to JSON designed to integrate more seamlessly when use as a configuration file. Thus mxjson supports comments and Murex code blocks embedded into the JSON schema.

mxjson is a format that is pre-parsed into a valid JSON format.

mxjson isn't a Murex data-type in that you cannot marshal and unmarshal mxjson files. Currently it is a format that is only supported by a small subset of Murex builtins (eg config and autocomplete) where config might embed Murex code blocks.

mxjson features the following enhancements:

Line Comments

Line comments are prefixed with a 'hash', #, just like with regular Murex code.

Block Quotation

Code blocks are quoted with (, ). For example, below "ExampleFunction" uses the ({ block quote }) method.

    "ExampleFunction": ({
        out "This is an example Murex function"
        if { =1==2 } then {
            err "The laws of the universe are broken"

Any block quoted by this method will be converted to the following valid JSON:

    "ExampleFunction": "\n    out \"This is an example Murex function\"\n    if { =1==2 } then {\n        err \"The laws of the universe are broken\"\n    }"

See Also

  • Code Block Parsing: Overview of how code blocks are parsed
  • %(Brace Quote): Initiates or terminates a string (variables expanded)
  • %[] Create Array: Quickly generate arrays
  • %{} Create Map: Quickly generate objects and maps
  • [[ Element ]]: Outputs an element from a nested structure
  • autocomplete: Set definitions for tab-completion in the command line
  • cast: Alters the data type of the previous function without altering it's output
  • config: Query or define Murex runtime settings
  • format: Reformat one data-type into another data-type
  • hcl: HashiCorp Configuration Language (HCL)
  • json: JavaScript Object Notation (JSON)
  • jsonc: Concatenated JSON
  • jsonl: JSON Lines
  • open: Open a file with a preferred handler
  • pretty: Prettifies JSON to make it human readable
  • runtime: Returns runtime information on the internal state of Murex
  • toml: Tom's Obvious, Minimal Language (TOML)
  • yaml: YAML Ain't Markup Language (YAML)
  • { Curly Brace }: Initiates or terminates a code block
  • index: Outputs an element from an array, map or table

Read more about type hooks

This document was generated from builtins/types/json/mxjson_doc.yamlopen in new window.

Last update:
Contributors: Laurence Morgan,Laurence Morgan,Laurence