Closed NickDarvey closed 3 years ago
Good catch. This looks like it can be an issue in other situations than just tuples though. We should probably have a more general solution, such as having isNullableFieldType
return true
for unit
.
Awesome, thanks! 👍
I was getting the error:
Unexpected null inside tuple-array. Expected type Unit, but got null.
when deserializing a type likeint * unit
. This PR removes null-checking forunit
types inside a tuple and adds a test.Use case
It's an odd thing to serialize, but I use
TenantId * RequestParameters
across all my Bolero IRemoteService endpoints. In a couple of places, there are noRequestParameters
so I useTenantId * unit
here to maintain a consistent shape. Without this PR, a_ * unit
tuple serializes but does not deserialize.Edit: A consistent shape is useful so I can write things like: