1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-19 01:17:04 +00:00
Files
norman/types
Colleen Murphy 6e4b2bab93 Add norman field attribute "pointer"
Add a new field attribute "pointer" to indicate that the generated
client code for the field must be a pointer. This allows clients to
differentiate between sending nil/leaving the value unset and sending an
empty map or slice.

This change also removes the `nullablestring` norman type introduced in
30f8d18 since schemas that need a pointer to a string can now use this
field attribute. There are no libraries currently using this feature so
it should be safe to remove.

Example usage:

```
Labels map[string]string `json:"labels" norman:"pointer"`
```

Resulting API schema:

```
"labels": {
  "create": true,
  "nullable": true,
  "pointer": true,
  "type": "map[string]",
  "update": true
}
```

Generated client code:

```
Labels *map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
```
2021-06-07 16:33:59 -07:00
..
2018-11-15 10:09:38 +08:00
2021-02-24 17:58:46 -07:00
2018-08-13 10:00:02 -07:00
2018-07-19 10:23:17 -07:00
2020-01-31 13:51:59 -07:00
2018-07-31 14:10:23 -07:00
2019-08-19 10:14:05 -07:00
2021-06-07 16:33:59 -07:00