mirror of
https://github.com/zoriya/typebox.git
synced 2026-05-27 08:33:16 +00:00
typebox-v2
This commit is contained in:
@@ -84,8 +84,8 @@ Null | `const T = Type.Null()` | `{
|
||||
Number | `const T = Type.Number()` | `{ type: "number" }` |
|
||||
String | `const T = Type.String()` | `{ type: "string" }` |
|
||||
Boolean | `const T = Type.Boolean()` | `{ type: "boolean" }` |
|
||||
Object | `const T = Type.Object({ name: Type.String() })` | `{ type: "object": properties: { name: { type: "string" }} }` |
|
||||
Array | `const T = Type.Array(Type.Object({ name: Type.String() }))` | `{ type: "array": items: { type: "object": properties: { name: { type: "string" }} } }` |
|
||||
Object | `const T = Type.Object({ name: Type.String() })` | `{ type: "object": properties: { name: { type: "string" } }, required: ["name"] }` |
|
||||
Array | `const T = Type.Array(Type.Object({ name: Type.String() }))` | `{ type: "array": items: { type: "object": properties: { name: { type: "string" } }, required: ["name"] } }` |
|
||||
Enum | `const T = Type.Enum("yes", "no")` | `{ type: "string", enum: ["yes", "no"] }` |
|
||||
Tuple | `const T = Type.Tuple(Type.String(), Type.Number())` | `{ type: "array", items: [{type: "string"}, {type: "number"}], additionalItems: false, minItems: 2, maxItems: 2 }` |
|
||||
Union | `const T = Type.Union(Type.String(), Type.Number())` | `{ anyOf: [{ type: "string"}, {type: "number"}] }` |
|
||||
|
||||
Reference in New Issue
Block a user