diff --git a/README.md b/README.md index 83527108b379da08fceed5d4e12cdf95cec65e6b..cb62ba1b4d23cb413384de0a7b56160621990173 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ CUE + Jsonnet ## Usage -[Example Schema](testdata/person/schema.cue) +[Example Schema](testdata/schema.cue) ```cue import "time" @@ -31,7 +31,7 @@ // Apply the schema to root #Schema ``` -[Example Jsonnet](testdata/person/valid.jsonnet) +[Example Jsonnet](testdata/fixed.jsonnet) ```jsonnet { @@ -41,23 +41,6 @@ age: 45, birthday: '01/02/2003', } ``` - -Embedding the schema is the recommended pattern: - -```go -//go:embed schema.cue -var schema cuesonnet.Schema - -var result MyStruct -if err := schema.Decode(r, &result); err != nil { - // handle validation errors -} -``` - -## Tests - -`testdata/` contains a large list of schemas and Jsonnet fixtures covering CUE features (types, constraints, structs, lists, disjunctions, defaults, definitions, composition, stdlib) and Jsonnet features (functions, comprehensions, conditionals, inheritance, multiline strings, self-reference, stdlib). -See `cuesonnet_test.go` and `cuesonnet_decode_test.go`. ## License