-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: x-omitempty for general types #1623
Labels
Comments
Closed with #1751 |
fredbi
added a commit
to fredbi/go-swagger
that referenced
this issue
Dec 26, 2019
* fixes go-swagger#2116 * tests are embedded with existing testcase for go-swagger#1623 (added by go-swagger#1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi
added a commit
to fredbi/go-swagger
that referenced
this issue
Dec 26, 2019
* fixes go-swagger#2116 * tests are embedded with existing testcase for go-swagger#1623 (added by go-swagger#1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Merged
fredbi
added a commit
to fredbi/go-swagger
that referenced
this issue
Jan 10, 2020
* fixes go-swagger#2116 * tests are embedded with existing testcase for go-swagger#1623 (added by go-swagger#1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi
added a commit
to fredbi/go-swagger
that referenced
this issue
Jan 10, 2020
* fixes go-swagger#2116 * tests are embedded with existing testcase for go-swagger#1623 (added by go-swagger#1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi
added a commit
to fredbi/go-swagger
that referenced
this issue
Jan 26, 2020
* fixes go-swagger#2116 * tests are embedded with existing testcase for go-swagger#1623 (added by go-swagger#1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi
added a commit
to fredbi/go-swagger
that referenced
this issue
Jan 26, 2020
* fixes go-swagger#2116 * tests are embedded with existing testcase for go-swagger#1623 (added by go-swagger#1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
fredbi
added a commit
that referenced
this issue
Jan 26, 2020
* Fixed x-omitempty in the case of $ref'ed schemas * fixes #2116 * tests are embedded with existing testcase for #1623 (added by #1751) * ensure arrays are not omitempty-ed by default, including arrays declared as properties Signed-off-by: Frederic BIDON <fredbi@yahoo.com> * * reverted on breaking change In order to avoid introducing breaking changes, adopted the following rule regarding default setting for omitempty on arrays: - arrays of primitives are by default not empty-omitted - arrays used as aliased types (e.g. in properties), remain empty-omitted by default Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem statement
Currently, we use
x-omitempty
to exclude null array value. related PR #1189Maybe
x-omitempty
can support general type to control theomityempty
tag.produce
Swagger specification
Steps to reproduce
Environment
swagger version: x.x.x
go version: x.x.x
OS:
The text was updated successfully, but these errors were encountered: