File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 3939 "additionalProperties" : false ,
4040 "$schema" : " http://json-schema.org/draft-07/schema#"
4141 },
42+ {
43+ "type" : " object" ,
44+ "properties" : {
45+ "filter" : {
46+ "type" : " string" ,
47+ "description" : " Filter the apps by name or description. Looks for substrings."
48+ }
49+ },
50+ "additionalProperties" : false ,
51+ "$schema" : " http://json-schema.org/draft-07/schema#"
52+ },
4253 {
4354 "type" : " object" ,
4455 "properties" : {
Original file line number Diff line number Diff line change @@ -182,6 +182,12 @@ export function convertJsonSchemaToZod(schema: JSONSchema): z.ZodTypeAny {
182182 shape [ key ] = shape [ key ] . optional ( ) ;
183183 }
184184 }
185+ } else {
186+ // In JSON Schema, properties are optional by default
187+ // if no required array is specified
188+ for ( const key of Object . keys ( shape ) ) {
189+ shape [ key ] = shape [ key ] . optional ( ) ;
190+ }
185191 }
186192
187193 // Create the schema with or without passthrough based on additionalProperties
You can’t perform that action at this time.
0 commit comments