We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6311905 commit ad34a93Copy full SHA for ad34a93
jsonschema/infer.go
@@ -90,6 +90,9 @@ func For[T any](opts *ForOptions) (*Schema, error) {
90
91
// ForType is like [For], but takes a [reflect.Type]
92
func ForType(t reflect.Type, opts *ForOptions) (*Schema, error) {
93
+ if opts == nil {
94
+ opts = &ForOptions{}
95
+ }
96
schemas := maps.Clone(initialSchemaMap)
97
// Add types from the options. They override the default ones.
98
maps.Copy(schemas, opts.TypeSchemas)
0 commit comments