On Tuesday, 19 July 2022 at 10:29:40 UTC, Antonio wrote:
The summary is that a DTO that works like a Map needs to represent the absent key ant this is not the same that the Null value

Example:
```d
struct Null { /*...*/ }
struct Undefined { /*...*/ }
struct ContactDto {
 DtoVal!(Undefined, string) name
 DtoVal!(Undefined, Null, string) phonenumber,
 DtoVal!(Undefined, AddressDto) address
}
// ...
ContactDto data = {phonenumber:Null(), address:{city:{code:"BCN"}}};
updateContact(id, data);

```

As I understand, in your scenario there's no difference between null string and empty string, they both work like empty string, and D treats them as empty string. That's what I mean when I said that distinction between null and empty is meaningless.

Reply via email to