Skip to content

Conversation

@rafaeljusto
Copy link
Contributor

When building the JSON schema for an array we should always allow "null" since any slice in Go can contain a nil value.

Resolves #48

When building the JSON schema for an array we should always allow "null" since
any slice in Go can contain a `nil` value.

Resolves google#48
@rafaeljusto
Copy link
Contributor Author

This is another behaviour change, so I assume we would also need to wrap it around JSONSCHEMAGODEBUG? Should we keep the same typeschemasnull=1 flag value or use a different one?

@jba
Copy link
Collaborator

jba commented Nov 19, 2025

This is another behaviour change, so I assume we would also need to wrap it around JSONSCHEMAGODEBUG? Should we keep the same typeschemasnull=1 flag value or use a different one?

Yes. You can use the same flag value.

Also please update the README describing the env var and both effects of this flag.

@jba
Copy link
Collaborator

jba commented Nov 19, 2025

Actually not the README. doc.go at the bottom. Add a new section: # Controlling behavior changes.
Describe the env var and list the flag values using a dotted (unordered) list. Even though there's only one.

@rafaeljusto
Copy link
Contributor Author

Done @jba ! Let me know if I should apply further changes. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow null for arrays

2 participants