Skip to main content
Mythic 4.0 adds the JSONString parameter type for payload build parameters and C2 profile parameters. The stored value remains a JSON string, while json_string_schema lets the Create Payload UI offer synchronized Visual and Source editors.
The schema is declarative UI metadata, not JSON Schema draft-07/2020-12. Use the supported vocabulary below.

Python example

The same schema can be supplied to C2ProfileParameter(..., parameter_type=ParameterType.JSONString, json_string_schema=http_config_schema).

Go example

For a C2 profile, use c2structs.C2_PARAMETER_TYPE_JSON_STRING and the JsonStringSchema field.

Schema vocabulary

All nodes can include label and description. A field inside an object’s fields can include:
  • show_when: {field: "sibling_name", in: [values...]} to control visibility;
  • placeholder_when: {field: "sibling_name", map: {value: "placeholder"}} for a contextual string placeholder.
Hidden fields keep their current value. Consumers should tolerate a value that is present even when its editor control is hidden.

Round-trip behavior

The Source editor holds the exact string. Switching to Visual calls JSON.parse; invalid JSON blocks the switch. Each visual change is serialized back with formatted JSON. The top-level schema should therefore describe the JSON document itself, normally an object. The UI seeds missing values as {} for objects and maps, [] for arrays, "" for strings, 0 for numbers, false for booleans, and the first enum choice when available.