This PR is targeting the wag-8.0-dev branch which will be used for development of wag-8 until we're ready to release it. That branch currently consists JUST of bumping the module suffix to v8 (from v7) and nothing else.
This PR bumps and unpins most go-openapi and go-swagger deps, including account for some breaking changes in how they are used. There are some changes to generated code, which will need to be documented in the eventual v8 release notes (see below). You can find all the non-generated code in the first commit, and the resulting changes to samples in the second commit.
Go field names
There are changes to the names of certain fields in the generated Go models. For example, before this PR, a field named podIDs used to generate a Go field named PodIds, and a field named oncallSlackChannel used to generate a field named OncallSLACKChannel. After this change, the Go fields are named PodIDs and OncallSlackChannel (note: I think it picked up on the abbreviation SLA for service level agreement in Slack).
To get the old behavior, a wag user can use the x-go-name field. For example:
This change ONLY affects marshaling, NOT unmarshaling. Before AND after, if a wag controller receives any of the following:
{}
{"some_field": null}
{"some_field": []}
the resulting HasArrayAlias will have some_field == []string{} (an empty slice).
It DOES, however, change how marshaling works. Before (in wag 7), HasArrayAlias{some_field: nil} marshals into "some_field":null, and HasArrayAlias{some_field: []string{}} turns into {"some_field":[]}. In wag 8, they both turn into {} (empty object).
Todo:
[X] Run make build
[X] Run make generate
[X] Update the current version in the /VERSION file.
This PR is targeting the wag-8.0-dev branch which will be used for development of wag-8 until we're ready to release it. That branch currently consists JUST of bumping the module suffix to v8 (from v7) and nothing else.
This PR bumps and unpins most go-openapi and go-swagger deps, including account for some breaking changes in how they are used. There are some changes to generated code, which will need to be documented in the eventual v8 release notes (see below). You can find all the non-generated code in the first commit, and the resulting changes to samples in the second commit.
Go field names
There are changes to the names of certain fields in the generated Go models. For example, before this PR, a field named
podIDs
used to generate a Go field namedPodIds
, and a field namedoncallSlackChannel
used to generate a field namedOncallSLACKChannel
. After this change, the Go fields are namedPodIDs
andOncallSlackChannel
(note: I think it picked up on the abbreviation SLA for service level agreement in Slack).To get the old behavior, a
wag
user can use thex-go-name
field. For example:Omitempty changes for types that are alias of slices.
Suppose the following appears in a definitions section:
In wag v7, the generated model
HasArrayAlias
would have a line like so:In wag v8, it gains "omitempty":
To preserve the old behavior, wecan use
x-omitempty: false
like so:This change ONLY affects marshaling, NOT unmarshaling. Before AND after, if a wag controller receives any of the following:
the resulting
HasArrayAlias
will havesome_field == []string{}
(an empty slice).It DOES, however, change how marshaling works. Before (in wag 7),
HasArrayAlias{some_field: nil}
marshals into"some_field":null
, andHasArrayAlias{some_field: []string{}}
turns into{"some_field":[]}
. In wag 8, they both turn into{}
(empty object).Todo:
make build
make generate
/VERSION
file.