Skip to content

Commit b1e53ed

Browse files
committed
Add What's Included section
1 parent f94db7d commit b1e53ed

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ Some [very simple](https://github.com/nexxtmove/json-schema-kit/blob/main/src/in
99
## ✨ Quick Taste
1010

1111
```ts
12-
import { object, string, number, array } from 'json-schema-kit'
12+
import { object, string, number, array, nullable } from 'json-schema-kit'
1313

1414
object({
1515
name: string(),
16-
price: number({ description: 'Price in dollars' }),
16+
price: number({ minimum: 0 }),
17+
description: nullable(string()),
1718
tags: array(string()),
1819
})
1920
```
@@ -68,6 +69,20 @@ object({
6869
})
6970
```
7071

72+
## 📦 What's Included
73+
74+
| Function | Example |
75+
| ---------------------- | --------------------------------- |
76+
| `string(props?)` | `string({ pattern: '^[A-Z]+$' })` |
77+
| `number(props?)` | `number({ minimum: 0 })` |
78+
| `integer(props?)` | `integer({ minimum: 1 })` |
79+
| `boolean(props?)` | `boolean()` |
80+
| `object(props, opts?)` | `object({ name: string() })` |
81+
| `array(items, props?)` | `array(string())` |
82+
| `nullable(schema)` | `nullable(string())` |
83+
| `$ref(name)` | `$ref('person')` |
84+
| `anyOf(schemas)` | `anyOf([string(), number()])` |
85+
7186
## 🔗 Using References
7287

7388
Use `$ref` to create reusable schema definitions and reference them throughout your schema:
@@ -96,7 +111,7 @@ Create union types using `anyOf` to allow multiple possible schemas:
96111
```ts
97112
const contactInfo = anyOf([
98113
object({ email: string() }),
99-
object({ phone: string() })
114+
object({ phone: string() }),
100115
])
101116
```
102117

0 commit comments

Comments
 (0)