(defschema Shipment {destination string? pilot string? spice int?}) (defschema Person [meet {age int?} {name string?}]) (defschema UnionSame [join {a string? b int?} {a string? b int?}]) (defschema UnionDifferent [join {a string? b int?} {a string? b int?}]) (defschema NestedIntersection [meet {details {z int?}} {details {a int?}}]) (defschema NestedUnion [join {details {a int? z int?}} {details {a int? z int?}}]) (defschema House {children [... House] name string?}) (let [render (fn [value options] (let [document (documents/from-value value) output (encoding/dust/encode document options)] (documents/close document) output)) render-document (fn [document options] (let [output (encoding/dust/encode document options)] (documents/close document) output)) value {destination "Arrakeen" extra "kept" pilot "Chani" spice 80}] [(render value {schema Shipment}) (render value {presentation {"" {order ["spice" "pilot" "destination"]}} schema Shipment}) (render-document (encoding/dust/decode ""{spice 80 destination "Arrakeen" pilot "Chani" extra "kept"}"") {order "source" schema Shipment}) (render value {order "sorted" schema Shipment}) (render value {presentation {"" {order ["spice" "destination" "pilot"]}}}) (render {steps [{a "x" b 1}]} {presentation {"" {order ["steps"]} /steps /steps/0 {order ["b" "a"]}}}) (render {age 18 name "Paul"} {schema Person}) (render {a "x" b 1} {schema UnionSame}) (render {a "x" b 1} {schema UnionDifferent}) (render {details {a 1 z 2}} {schema NestedIntersection}) (render {details {a 1 z 2}} {schema NestedUnion}) (render [[1 2]] {presentation {/0 }}) (render ~"hello ,{a 1 z 2}" {presentation {/1/0 { order ["z" "a"]}}}) (render-document (encoding/dust/decode "/x/,{a 1 z 2}"
) {presentation {/1 { order ["z" "a"]}}}) (render { name "Chani"} {presentation {"" {order ["name" "active"]}}}) (render {presentation {"" {order ["c" "b"]}}}) (render {children [{children [] name "Paul"}] name "Atreides"} {schema House}) (render {pilot "Chani"} {schema Shipment}) (render-document (encoding/dust/decode """ {pilot "Chani" ; pilot note destination "Arrakeen"} """ ) {schema Shipment})])