Skip to content

Commit 1ce9090

Browse files
committed
fix: update expandSimpleSchema to clarify optional properties handling
- Removed unnecessary pushes to the required array in expandSimpleSchema function. - Added comments to indicate that all properties are optional by default in simple syntax.
1 parent a927234 commit 1ce9090

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/api/params.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ function expandSimpleSchema(simple: Record<string, any>): InputSchema {
3737

3838
if (typeof val === 'string') {
3939
propSchema = { type: 'string', description: val }
40-
required.push(key)
40+
// In simple syntax, everything is optional by default
4141
} else if (typeof val === 'number') {
4242
propSchema = { type: 'number', description: String(val), default: val }
43-
required.push(key)
43+
// In simple syntax, everything is optional by default
4444
} else if (typeof val === 'boolean') {
4545
propSchema = { type: 'boolean', description: '', default: val }
46-
required.push(key)
46+
// In simple syntax, everything is optional by default
4747
} else if (Array.isArray(val)) {
4848
propSchema = { type: 'array', description: '', default: val }
49-
required.push(key)
49+
// In simple syntax, everything is optional by default
5050
} else if (typeof val === 'object' && val !== null) {
5151
// Assume user provided a detailed schema for this property
5252
propSchema = val
53-
required.push(key)
53+
// In simple syntax, everything is optional by default
5454
} else {
5555
// Fallback to string type
5656
propSchema = { type: 'string' }
57-
required.push(key)
57+
// In simple syntax, everything is optional by default
5858
}
5959

6060
properties[key] = propSchema

0 commit comments

Comments
 (0)