Closed YasserRabee closed 1 year ago
I think it's okay to make this breaking change, I'd see this as a bugfix.
This PR will change the output of the tests, you can run
UPDATE_SCENARIO=true go test ./
To update them automatically. In one test case, the nil check produces a compile error.
Thanks @jmattheis. I have handled the fixed length lists correctly, and updated the test scenarios.
In our usecase, nil slice is not the same as empty slice. This patch maps nil slices to nil.
This changes may affect users who depended on the older behavior that converts nil slices to empty slices. For example, encoding a nil slice in a JSON response will be
null
but empty slice will be[]
. So users who don't tolerate this in their code flow may be affected.I suggest to enable this behavior on-demand, but couldn't resolve a possible solution.