string [VALUE]
Creates a string value.
Block type: REPORTER. Opcode: string. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
VALUE | STRING | sensor |
Complete block reference (18 blocks)
TurboWarp YAML/JSON builds structured data as immutable reporter values. The same data can be rendered as YAML or JSON, and it can be validated with JSON Schema before serving.
pair key [name] value [string [sensor]]
pair key [temperature] value [number [21]]
[name pair] followed by [temperature pair]
map [combined pairs]
render YAML [map result]
render JSON [map result]
validate JSON Schema [{"type":"object","required":["temperature"]}] data [map result]
JSON Schema [{"type":"object","required":["temperature"]}] accepts data [map result]?
| Category | Blocks |
|---|---|
| Scalars | string, number, boolean, nullValue |
| Containers | pair, map, sequence |
| Composition | concat |
| Output | renderYaml, renderJson |
| Validation | validateSchema, isValidSchema |
For turbowarp-http-server, pass the rendered string as the response body and set Content-Type: application/yaml; charset=utf-8 or Content-Type: application/json; charset=utf-8.
The package also exports block-free builder functions from @kubohiroya/turbowarp-yaml-json, including stringValue, numberValue, booleanValue, nullValue, pair, map, sequence, concat, renderYaml, renderJson, and validateWithJsonSchema.
All 18 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.
string [VALUE]Creates a string value.
Block type: REPORTER. Opcode: string. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
VALUE | STRING | sensor |
number [VALUE]Creates a finite number value.
Block type: REPORTER. Opcode: number. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
VALUE | NUMBER | 21 |
boolean [VALUE]Creates a boolean value.
Block type: REPORTER. Opcode: boolean. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
VALUE | BOOLEAN | true |
nullCreates a null value.
Block type: REPORTER. Opcode: nullValue. Permanent link
This block has no arguments.
pair key [KEY] value [VALUE]Creates a map key/value pair.
Block type: REPORTER. Opcode: pair. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
KEY | STRING | temperature | |
VALUE | STRING | 21 |
map [ENTRIES]Creates an object/map from pair fragments.
Block type: REPORTER. Opcode: map. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
ENTRIES | STRING | |
sequence [ITEMS]Creates an array/sequence from item fragments.
Block type: REPORTER. Opcode: sequence. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
ITEMS | STRING | |
[LEFT] followed by [RIGHT]Combines fragments without mutating either input.
Block type: REPORTER. Opcode: concat. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
LEFT | STRING | | |
RIGHT | STRING | |
render YAML [FRAGMENT]Renders a fragment to YAML text.
Block type: REPORTER. Opcode: renderYaml. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
FRAGMENT | STRING | |
render JSON [FRAGMENT]Renders a fragment to formatted JSON text.
Block type: REPORTER. Opcode: renderJson. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
FRAGMENT | STRING | |
validate JSON Schema [SCHEMA] data [FRAGMENT]Returns JSON Schema validation details for the built data.
Block type: REPORTER. Opcode: validateSchema. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
SCHEMA | STRING | {"type":"object","required":["temperature"]} | |
FRAGMENT | STRING | |
JSON Schema [SCHEMA] accepts data [FRAGMENT]?Reports whether the built data passes JSON Schema validation.
Block type: BOOLEAN. Opcode: isValidSchema. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
SCHEMA | STRING | {"type":"object","required":["temperature"]} | |
FRAGMENT | STRING | |
parse [TEXT] as [FORMAT]Safely parses the provided YAML or JSON text into a fragment.
Block type: REPORTER. Opcode: parseText. Permanent link
| Argument | Type | Default value | Menu choices |
|---|---|---|---|
TEXT | STRING | name: sensor | |
FORMAT | STRING | auto |
|
last parse succeeded?Reports whether the most recent parse operation succeeded.
Block type: BOOLEAN. Opcode: lastParseSucceeded. Permanent link
This block has no arguments.
last parse formatReports the format selected by the most recent parse operation.
Block type: REPORTER. Opcode: lastParseFormat. Permanent link
This block has no arguments.
last parse diagnosticReports the code, location, and message for the most recent parse failure.
Block type: REPORTER. Opcode: lastParseDiagnostic. Permanent link
This block has no arguments.
last parse error lineReports the one-based line of the most recent parse failure, or zero when unavailable.
Block type: REPORTER. Opcode: lastParseLine. Permanent link
This block has no arguments.
last parse error columnReports the one-based column of the most recent parse failure, or zero when unavailable.
Block type: REPORTER. Opcode: lastParseColumn. Permanent link
This block has no arguments.
対応GUIの固定入力機能は既定OFFです。既存値は開いただけでは変更せず、reporter接続は評価・置換しません。新しい選択と有限JSON数値入力のみを検証して保存し、既存の補正・丸め処理を維持します。機能OFFで従来の編集へ戻せます。