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.
Prior, empty array were converted to nil. In some cases the
difference between a nil and empty array are not arbitrary.
Now, empty arrays will be converted to empty interface arrays
and nil array will be converted to nil interface arrays.
Added enable function to schemas. This allows filtering of schemas
which is a required part of feature flagging in rancher. Added
addFeature functions to controller template for adding handlers that
can be disabled if their associated feature is disabled.
There is now a recognized option for opting out of pagination.
Prior, passing a limit of -1 would set the pagination limit to
the default, 1000. Now, a value of -1 will set the pagination
limit to the max, likely resulting in a non paginated response.
Problem:
Pagination is not showing up
Solution:
Pagination was being created properly but then dropped in favor of an
empty version. Save the pagination on the context so it can be accessed
later and not reset.
PostForm will ignore URL query parameters and will only look at the
body. This is much more useful for actions, which have a query param
that is the action name, but the a json body. WIthout this change,
the only "field" found when parsing an action body is the name of the
action.
When parsing URL paths, unescape them so that characters that needed escaped
in order to be placed in the a path segment are returned to their original
form.