Add YAML middleware that behaves like TOML and JSON (#1093)

This commit is contained in:
Micah
2025-08-02 20:58:13 -07:00
committed by GitHub
parent 3002d250a1
commit a4eb65ca3f
7 changed files with 332 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
---
source: src/snapshot_middleware/yaml.rs
expression: source
---
return {
string = "this is a string",
boolean = true,
integer = 1337,
float = 123456789.5,
["value-with-hypen"] = "it sure is",
sequence = {"wow", 8675309},
map = {
key = "value",
key2 = "value 2",
key3 = "value 3",
},
["nested-map"] = {{
key = "value",
}, {
key2 = "value 2",
}, {
key3 = "value 3",
}},
whatever_this_is = {"i imagine", "it's", "a", "sequence?"},
null1 = nil,
null2 = nil,
}

View File

@@ -0,0 +1,21 @@
---
source: src/snapshot_middleware/yaml.rs
expression: instance_snapshot
---
snapshot_id: "00000000000000000000000000000000"
metadata:
ignore_unknown_instances: false
instigating_source:
Path: /foo.yaml
relevant_paths:
- /foo.yaml
- /foo.meta.json
context:
emit_legacy_scripts: true
specified_id: ~
name: foo
class_name: ModuleScript
properties:
Source:
String: "return {\n\tstring = \"this is a string\",\n\tboolean = true,\n\tinteger = 1337,\n\tfloat = 123456789.5,\n\t[\"value-with-hypen\"] = \"it sure is\",\n\tsequence = {\"wow\", 8675309},\n\tmap = {\n\t\tkey = \"value\",\n\t\tkey2 = \"value 2\",\n\t\tkey3 = \"value 3\",\n\t},\n\t[\"nested-map\"] = {{\n\t\tkey = \"value\",\n\t}, {\n\t\tkey2 = \"value 2\",\n\t}, {\n\t\tkey3 = \"value 3\",\n\t}},\n\twhatever_this_is = {\"i imagine\", \"it's\", \"a\", \"sequence?\"},\n\tnull1 = nil,\n\tnull2 = nil,\n}"
children: []