-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Is your feature request related to a problem? Please describe.
I want to control whether a slice field is nullable or not. JSONSCHEMAGODEBUG environment variable might help but I still feel inconvenient:
- Not build-time configuration
- It can cause mismatch between dev and prod
- Less configurable
- It is all or nothing. Can't control for each schema.
Describe the solution you'd like
// Approach 1: tag
type A struct {
Things []int `jsonschemanull:"false"`
}
// Approach 2: option
For[MyType](&ForOption{
Null: true, // we should consider more understandable name
})Describe alternatives you've considered
N/A
Additional context
I want to utilze it to generate schema and pass it to a library. But the library we use doesn't support ["null", "array"] as of now.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels