TurboWarp YAML/JSON

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.

Core Flow

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]

Validation Flow

validate JSON Schema [{"type":"object","required":["temperature"]}] data [map result]
JSON Schema [{"type":"object","required":["temperature"]}] accepts data [map result]?

Common Blocks

CategoryBlocks
Scalarsstring, number, boolean, nullValue
Containerspair, map, sequence
Compositionconcat
OutputrenderYaml, renderJson
ValidationvalidateSchema, isValidSchema

HTTP Server Interoperability

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.

TypeScript API

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.

TurboWarp YAML/JSON: complete block reference

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

ArgumentTypeDefault valueMenu choices
VALUESTRINGsensor

number [VALUE]

Creates a finite number value.

Block type: REPORTER. Opcode: number. Permanent link

ArgumentTypeDefault valueMenu choices
VALUENUMBER21

このブロックの固定入力編集と互換性

boolean [VALUE]

Creates a boolean value.

Block type: REPORTER. Opcode: boolean. Permanent link

ArgumentTypeDefault valueMenu choices
VALUEBOOLEANtrue

null

Creates 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

ArgumentTypeDefault valueMenu choices
KEYSTRINGtemperature
VALUESTRING21

map [ENTRIES]

Creates an object/map from pair fragments.

Block type: REPORTER. Opcode: map. Permanent link

ArgumentTypeDefault valueMenu choices
ENTRIESSTRING

sequence [ITEMS]

Creates an array/sequence from item fragments.

Block type: REPORTER. Opcode: sequence. Permanent link

ArgumentTypeDefault valueMenu choices
ITEMSSTRING

[LEFT] followed by [RIGHT]

Combines fragments without mutating either input.

Block type: REPORTER. Opcode: concat. Permanent link

ArgumentTypeDefault valueMenu choices
LEFTSTRING
RIGHTSTRING

render YAML [FRAGMENT]

Renders a fragment to YAML text.

Block type: REPORTER. Opcode: renderYaml. Permanent link

ArgumentTypeDefault valueMenu choices
FRAGMENTSTRING

render JSON [FRAGMENT]

Renders a fragment to formatted JSON text.

Block type: REPORTER. Opcode: renderJson. Permanent link

ArgumentTypeDefault valueMenu choices
FRAGMENTSTRING

validate JSON Schema [SCHEMA] data [FRAGMENT]

Returns JSON Schema validation details for the built data.

Block type: REPORTER. Opcode: validateSchema. Permanent link

ArgumentTypeDefault valueMenu choices
SCHEMASTRING{"type":"object","required":["temperature"]}
FRAGMENTSTRING

JSON Schema [SCHEMA] accepts data [FRAGMENT]?

Reports whether the built data passes JSON Schema validation.

Block type: BOOLEAN. Opcode: isValidSchema. Permanent link

ArgumentTypeDefault valueMenu choices
SCHEMASTRING{"type":"object","required":["temperature"]}
FRAGMENTSTRING

parse [TEXT] as [FORMAT]

Safely parses the provided YAML or JSON text into a fragment.

Block type: REPORTER. Opcode: parseText. Permanent link

ArgumentTypeDefault valueMenu choices
TEXTSTRINGname: sensor
FORMATSTRINGauto
  • auto
  • YAML
  • JSON

このブロックの固定入力編集と互換性

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 format

Reports the format selected by the most recent parse operation.

Block type: REPORTER. Opcode: lastParseFormat. Permanent link

This block has no arguments.

last parse diagnostic

Reports 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 line

Reports 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 column

Reports 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.

Repository guide and examples

固定入力の編集

対応GUIの固定入力機能は既定OFFです。既存値は開いただけでは変更せず、reporter接続は評価・置換しません。新しい選択と有限JSON数値入力のみを検証して保存し、既存の補正・丸め処理を維持します。機能OFFで従来の編集へ戻せます。

対象入力・Schemaの正本・互換性・切戻し