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

populateUpdate marshals JSON instead of TypedValue scalars #802

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

wenovus
Copy link
Collaborator

@wenovus wenovus commented Apr 7, 2023

In gnmidiff for simplicity we want to have a uniform way of encoding values due to the chance that both JSON and TypedValue scalars can both be inputs at the same time. This means when diffing programmatically and visually (via CLI) the values can be compared apples-to-apples and it relieves the user of having to deal with type differences.

Previously TogNMINotifications was called which outputs scalars, but for uniformity Marshal7951 is now used. There is actually no strict advantage to using TypedValue scalars due to the fact that YANG -> TypedValue conversion is lossy (namely all int/uint values get squished to int64/uint64), and so there is no way to accurately convert TypedValue scalar to JSON since int64/int32 are treated differently.

Also double-val conversion is now done correctly (to string instead of float64)

@wenovus wenovus requested a review from DanG100 April 7, 2023 23:01
@coveralls
Copy link

Coverage Status

Coverage: 90.187% (+0.1%) from 90.078% when pulling 3b35597 on fix-json-repr into a9ad813 on master.

@wenovus wenovus merged commit 4c36185 into master Apr 7, 2023
@wenovus wenovus deleted the fix-json-repr branch April 7, 2023 23:48
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.

3 participants