File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,10 @@ function handleMergedSchema(mergedSchema: JSONSchema7): Result<ParsedProcedure>
186186// zod-to-json-schema turns `z.string().optional()` into `{"anyOf":[{"not":{}},{"type":"string"}] }`
187187function isOptional ( schema : JSONSchema7Definition ) {
188188 if ( schema && typeof schema === 'object' && 'optional' in schema ) return schema . optional === true
189+ if ( schemaDefPropValue ( schema , 'not' ) && JSON . stringify ( schema ) === '{"not":{}}' ) return true
189190 const anyOf = schemaDefPropValue ( schema , 'anyOf' )
190- if ( anyOf ?. length === 2 && JSON . stringify ( anyOf [ 0 ] ) === '{"not":{}}' ) return true
191191 if ( anyOf ?. some ( sub => isOptional ( sub ) ) ) return true
192+ if ( schemaDefPropValue ( schema , 'default' ) !== undefined ) return true
192193 return false
193194}
194195
You can’t perform that action at this time.
0 commit comments