When generating types, any field with name "id" was being skipped. The intention
here was to skip the "id" field of the embedded types.Resource struct. A type
will have an embedded types.Resource struct when the hasGet function returns
true. Therefore, this hasGet function is also used to skip the id fields as
desired.
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"`
```
Currently, `*string` fields in Go structs are converted to `{type:
string, nullable: true}` in the API schema, which is right, but then
converted down to just `string` when converted to generated client
structs. Without this patch, there is no way to express that `*string`s
should stay as `*string`s when run through the generator, because the
'nullable' flag is ignored. Compare this to `*bool`s, which become
`boolean` in the schema and then correctly converted back to *bool in
the generator. This patch adds a backwards-compatible way to opt in to
converting `*string`s in the original struct to *strings in the
generated struct.
Allows users to specify "backend" types that will have kubernetes
controllers and clients generated but no Rancher client generated.
The intended use to allow for creating a CRD and the supporting code
without having to expose the CRD in the Rancher API.
Problem:
Collections have actions but are not accessable through the types
clients
Solution:
Update template and generator to output actions living on collections