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 when converting message to JSON for display #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

will-osborne
Copy link

Summary

This change enables visibility of default values in the request and response objects.
E.g empty strings and false booleans.
what would have show as this before

{
  "foo": "bar"
}

Looks like this after

{
  "foo": "bar",
  "baz": "",
  importantBoolean: false
}

Problem description

Not displaying defalt values is misleading and is against the idioms of GRPC.

Pros/cons of approach implemented

Pros: It's simple and uses existing functionality.
Cons: It's non-configurable.

Checklist

  • Is this PR a reasonable size?

Code Review Guidelines for Reviewers

  • Try to review in a timely manner. Opinions/nitpicks should not be blockers. Pair on a call for non-trivial feedback.
  • Overall design and approach should follow established patterns. Don't try to make the PR perfect.
  • Try to identify edge cases, race conditions, over-engineering, lack of test coverage and complexity.
  • If you don't feel qualified to review the code, pass it on to someone who is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant