Home

cuesonnet @0914371465d237469d1a8e9ef7bdca63a69ddc96 - refs - log -
-
https://git.jolheiser.com/cuesonnet.git
CUE + Jsonnet
cuesonnet / testdata / schema.cue
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
import "time"

#Schema: {
	// Basic schema
	firstName: string
	lastName:  string
	age:       int
	birthday:  string

	// Refine as needed
	#Title:    =~"^[A-Z]" | error("must start with an uppercase letter")
	firstName: #Title
	lastName:  #Title
	age:       >0
	birthday:  time.Format("01/02/2006")

	// Defaults
	gopher: bool | *true
}

// Apply the schema to root
#Schema