Skip to content

Conversation

@LeakyBucket
Copy link

This adds a redact option to the derive.

I've recently had a few situations where it is undesirable to send null to an external API (GraphQL, enum attributes). I've implemented a couple of ugly solutions in my own code but thought it would be really nice if I could just specify an explicit empty indicator and have that entire pair omitted from the generated JSON.

This PR does that.

This allows for the implementor of a struct to specify that attributes with a given value should not be included in the generated `JSON`.
@coveralls
Copy link

coveralls commented Sep 11, 2018

Pull Request Test Coverage Report for Build 243

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 89.474%

Totals Coverage Status
Change from base Build 236: 0.05%
Covered Lines: 187
Relevant Lines: 209

💛 - Coveralls

@LeakyBucket
Copy link
Author

@devinus any interest in this?

@devinus devinus force-pushed the master branch 22 times, most recently from 29a475d to e0a080a Compare July 23, 2021 07:52
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.

2 participants