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

json diagnostic #1091

Merged
merged 2 commits into from
Oct 11, 2024
Merged

json diagnostic #1091

merged 2 commits into from
Oct 11, 2024

Commits on Oct 11, 2024

  1. Configuration menu
    Copy the full SHA
    00b8d4d View commit details
    Browse the repository at this point in the history
  2. JSON serialize Vec<u8> fields as hex

    serde_json has no simple way to serialize specific field types as hex,
    until specialization is merged. This commit contains a hack to serialize
    all Vec<u8> fields as hex anyway. It is impossible to check the type of
    a generic type parameter at runtime. So all values are first serialized,
    then attempted to deserialize into a Vec<u8>. If that works, the found
    vector will be serialized as a hex string, rather than an array of
    numbers. This is not a performant machanism, but it gets the job done.
    As long as it is only used for dev commands and diagnostic data it
    should be fine. At least all those number arrays in the diagnostic data
    are now gone, without having to duplicate every struct definition just
    for serialization.
    
    Note that the 'Value' serialization is a copy of the real one.
    JssDWt committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    ce23e32 View commit details
    Browse the repository at this point in the history