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

[health 3.4.4] missing HealthDataTypes in the json helper const HealthDataTypeJsonValue #533

Closed
fix92 opened this issue Apr 19, 2022 · 1 comment
Labels
bugfix a bug fix

Comments

@fix92
Copy link

fix92 commented Apr 19, 2022

(will open a PR shortly for this)

Describe the bug

When calling toJson() on fetched HealthDataPoints that are being read from health, a const Map<HealthDataType, String> HealthDataTypeJsonValue is used to determine the string value in the json, usually just the lower case enum name.

In November 2021 five nutrition data types were added where those values have not been added to this Mapping: #430

  DIETARY_CARBS_CONSUMED,
  DIETARY_ENERGY_CONSUMED,
  DIETARY_FATS_CONSUMED,
  DIETARY_PROTEIN_CONSUMED,
  FORCED_EXPIRATORY_VOLUME,

To Reproduce

Read any of the above described data types from health and call toJson() on them.

Expected behavior

A Json Object containing a non-empty String in the data_type field.

Actual behavior

A Json Object containing an empty String as data_type field.

@fix92
Copy link
Author

fix92 commented Jun 8, 2022

closing this as the HealthDataTypeJsonValue was replaced to a proper generic way of serializing to json

@fix92 fix92 closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix a bug fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant