-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add public current depth field to JSON reader. #1802
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bb2951e
Add public current depth field to JSON reader.
ahsonkhan 7529b71
Add a CL entry.
ahsonkhan e3fd307
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-c into …
ahsonkhan 6cb3a3f
Fix typo in src comment.
ahsonkhan 0791700
Merge branch 'main' into DepthPublic
ahsonkhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeffreyRichter, do you think it makes more sense to expose this field from the
az_json_token
struct rather than from theaz_json_reader
? I have it from the reader because it is easier to access from the caller (the user doesn't have to fish it out from the nested token field), but the depth can be thought of as a property of a particular JSON token.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share the customer code that uses this field. The usage patterns would probably highlight if it should be on the reader on the token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did above in the PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why I didn't want to add it to the token is, right now, the token can be created as a standalone type, and used outside of the reader (at least when looking at the public fields). Adding depth to it turns it into something that has to be a part of a larger JSON payload (and then we might not be able to use it in the future for other cases like in the writer).
Also, in .NET, I had added the depth on the reader directly (but we didn't have the nested token struct there) :)
The reason why I posed the question is because I feel that if we emphasize single responsibility, a case can easily be made to move the field to az_json_token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All that said, this is still in beta and we can revisit it separately, if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw I'd prefer in the json reader rather than the token unless there's a good reason for it to be in the token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will close on it later, and decide if a change is needed or we are happy where we are:
#1808