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

Omit empty fields of State struct #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DimitarPetrov
Copy link

@DimitarPetrov DimitarPetrov commented Jun 25, 2019

There are cases where some of the fields are presented in the serialized State without meaningful value.
For example if a component's status is ok there is still fields first_failure_at and num_failures with zero values.

Also there are situation where State struct could be used as a DTO for the overall status of the system, in this cases it is useful name and check_time also to be omitted since they also will be empty.

Also the Fatal field must be presented always so you know if a check is fatal or not. Not only presented for the fatal checks and omitted for all non fatal checks.

@schigh
Copy link
Contributor

schigh commented Sep 26, 2019

@DimitarPetrov apologies for the late response. I will look into this and get turned around momentarily.

hebime
hebime previously approved these changes Sep 26, 2019
Copy link
Contributor

@hebime hebime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. Looks good! 🍦

@hebime hebime added the v3 version 3 label Sep 26, 2019
@hebime
Copy link
Contributor

hebime commented Sep 26, 2019

@DimitarPetrov since this is changing the response and could potentially cause issues for others parsing it, we've decided to include this in V3.

@hebime hebime dismissed their stale review September 26, 2019 17:23

Will merge for V3

Copy link

@luisdavim luisdavim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

4 participants