Home

cuesonnet @main - refs - log -
-
https://git.jolheiser.com/cuesonnet.git
CUE + Jsonnet
cuesonnet / testdata / composition / 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
23
import "time"

let MaxAge = 150

#Named: {
	firstName: string
	lastName:  string
}

#Timestamped: {
	createdAt: time.Format(time.RFC3339)
	updatedAt: time.Format(time.RFC3339)
}

// Embed definitions inside the body to compose them with new fields.
// & between two closed definitions cannot add new fields; embedding can.
#Person: {
	#Named
	#Timestamped
	age: int & >=0 & <=MaxAge
}

[...#Person]