-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sanitize null arrays to [] #75
Comments
As a consumer of the HTTP API, I would greatly prefer to receive an empty array compared to null, since you don't really have to have any special logic, you just can treat it as an array while |
I agree that this would be preferable, but unfortunately I don't really know how to do that without either (a) initializing all nil slices to empty slices or (b) using custom types for all slices with I'll try to find all instances in this package, though. |
@keks I've filed a feature request to always encode slices/maps to If that works out, we can just replace the json library with that one. |
Currently, depending on circumstances arrays can be either Marshalled to JSON as null or []. It would be best if we send just one format, possibly the [].
The text was updated successfully, but these errors were encountered: