1
0
mirror of https://github.com/rancher/norman.git synced 2025-08-17 14:56:42 +00:00
norman/parse
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
..
builder Add norman field attribute "pointer" 2021-06-07 16:33:59 -07:00
browser.go More initial dev 2017-11-10 21:46:30 -07:00
collection.go Add no pagination option 2019-04-05 16:42:43 -07:00
parse.go Add enable function and addFeature functions 2019-07-02 12:18:40 -07:00
read_input.go add yaml support 2018-06-04 16:44:48 -07:00
subcontext.go Major refactor of subcontexts 2018-02-09 13:45:22 -07:00
validate.go Many enhancements 2017-12-11 20:58:53 -07:00