Skip to content
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

Emit default values in marshalled JSON (with tests) #628

Commits on Apr 28, 2018

  1. runtime - Emit default values in marshalled JSON

    In order to make APIs more restful, require the marshaler to emit
    default values. By default, it omits empty types. This causes
    unexpected REST behavior by omitting all false values or zero-valued
    integers.
    
    If you like to override its behavior back, use the WithMarshalerOption:
    
    ```go
    gwmux := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: false}))
    ```
    
    Closes grpc-ecosystem#233
    philipithomas authored and flw-cn committed Apr 28, 2018
    Configuration menu
    Copy the full SHA
    0a0ab21 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    53f521d View commit details
    Browse the repository at this point in the history
  3. Test: just for test CI

    flw-cn committed Apr 28, 2018
    Configuration menu
    Copy the full SHA
    f588bc4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e7eb9f1 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2018

  1. Style: just gofmt

    flw-cn committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    b7100fe View commit details
    Browse the repository at this point in the history