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

Adds values of unamed array to additional data #96

Closed
wants to merge 5 commits into from

Conversation

rkodev
Copy link
Contributor

@rkodev rkodev commented Jul 11, 2023

Currenty serialization of an array of arrays into additional data results in a complete loss of the data in the array. Additional data can only hold a key value pair i.e if an array is a direct decendant of an array the values are lost.

This fix introduces a constant ArraysAdditionalData in the additional data and saves the unnamed arrays to the value and prevent data loss

A possible fix for microsoftgraph/msgraph-sdk-go#473

@rkodev rkodev requested a review from a team July 11, 2023 20:16
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

70.6% 70.6% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

There's one thing I don't understand. You added this Json struct that seems to be designed to represent arbitrary JSON.
But you're not using it to wrap around this special case, instead relying on a "magic key" and a lot of type assertions.
Wouldn't it be better from an API surface perspective to have something that can hold arbitrary JSON, with a clean API surface (isArray, getItem, etc...) and return that instead? Arguably it'd kind of duplicate some of the JsonParseNode work and instead we should add missing methods to Json parse node instead.

@github-actions
Copy link
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

@rkodev rkodev closed this Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants