Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a generic 'nullable*' type to allow maps and arrays to be nullable. Example usage: Labels map[string]string `json:"labels" norman:"type=nullablemap[string]"` Resulting API schema: "labels": { "create": true, "nullable": true, "type": "nullablemap[string]", "update": true } Generated client code: Labels *map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` Without this, because the generated client code uses "omitempty" JSON tags, clients can't differentiate between an unset value and an empty value. With this change, the generated client code becomes a map pointer which allows clients to differentiate between sending `nil` and sending `map[string]string{}`. The underlying type can still be a regular map.
- Loading branch information