Skip to content

Commit a079b05

Browse files
committed
Spec
1 parent 4b8ad67 commit a079b05

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

readme.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,19 @@ import Schema from 'typebox/schema'
211211
// Compile
212212
// -------------------------------------------------------------------------------
213213

214-
const User = Schema.Compile(Type.Object({
215-
id: Type.String(),
216-
name: Type.String(),
217-
email: Type.String({ format: 'email' })
218-
}))
214+
const User = Schema.Compile({
215+
type: 'object',
216+
properties: {
217+
id: { type: 'string' },
218+
name: { type: 'string' },
219+
email: { type: 'string', format: 'email' }
220+
},
221+
required: [
222+
'id',
223+
'name',
224+
'email'
225+
]
226+
})
219227

220228
// -------------------------------------------------------------------------------
221229
// Parse

0 commit comments

Comments
 (0)