Update resp2_replies.json about JSON.CLEAR#286
Open
momadvisor wants to merge 2 commits into
Open
Conversation
fix a wrong and add a new Signed-off-by: momadvisor <77181890+momadvisor@users.noreply.github.com>
make more concrete Signed-off-by: momadvisor <77181890+momadvisor@users.noreply.github.com>
| " * The number of containers cleared.", | ||
| " * Returns 0 if clearing an empty array or object.", | ||
| " * Returns 0 if clearing a non-container value.", | ||
| " * Returns 0 if clearing a non-container value except JSON string.", |
Contributor
There was a problem hiding this comment.
not sure if we need this.
Member
There was a problem hiding this comment.
Suggested change
| " * Returns 0 if clearing a non-container value except JSON string.", | |
| " * Returns 0 if clearing a non-container value.", |
| " * Returns 0 if clearing a non-container value.", | ||
| " * Returns 0 if clearing a non-container value except JSON string.", | ||
| " * Returns 0 if no array or object value is located by the path.", | ||
| " * Always Returns 1 if clearing a JSON string value regardless of the length of the JSON string value including empty string.", |
Contributor
There was a problem hiding this comment.
Suggested change
| " * Always Returns 1 if clearing a JSON string value regardless of the length of the JSON string value including empty string.", | |
| " *Returns 1 when clearing a JSON value.", |
Member
There was a problem hiding this comment.
it return the count of values, so this is incorrect.
roshkhatri
reviewed
Jun 5, 2026
Member
roshkhatri
left a comment
There was a problem hiding this comment.
We will also need to edit the resp3_replies.json
dom_clear:
} else if (v.first->IsBool()) {
if (v.first->IsTrue()) {
v.first->SetBool(false); // true --> false (counted)
elements_cleared++;
}
} else if (v.first->IsInt()) {
if (v.first->GetInt() != 0) {
v.first->SetInt(0); // non-zero int --> 0 (counted)
elements_cleared++;
}
} else if (v.first->IsInt64()) { if (... != 0) { SetInt64(0); ... } }
} else if (v.first->IsUint()) { if (... != 0) { SetUint(0); ... } }
} else if (v.first->IsUint64()) { if (... != 0) { SetUint64(0); ... } }
} else if (v.first->IsDouble()) {
if (GetDouble() < 0.0 || GetDouble() > 0.0) {
v.first->SetDouble("0.0", 3, allocator); // non-zero double --> 0.0 (counted)
elements_cleared++;
}
}
Comment on lines
747
to
748
| " * The number of containers cleared.", | ||
| " * Returns 0 if clearing an empty array or object.", |
Member
There was a problem hiding this comment.
Suggested change
| " * The number of containers cleared.", | |
| " * Returns 0 if clearing an empty array or object.", | |
| " * The number of values cleared.", | |
| " * A value is counted only when clearing changes it: a non-empty array or object is emptied, a non-empty string is set to empty, a non-zero number is set to 0, and true is set to false.", | |
| " * Returns 0 for a value already empty, zero, false, or null.", |
| " * Returns 0 if clearing a non-container value.", | ||
| " * Returns 0 if clearing a non-container value except JSON string.", | ||
| " * Returns 0 if no array or object value is located by the path.", | ||
| " * Always Returns 1 if clearing a JSON string value regardless of the length of the JSON string value including empty string.", |
Member
There was a problem hiding this comment.
it return the count of values, so this is incorrect.
| " * Returns 0 if clearing a non-container value.", | ||
| " * Returns 0 if clearing a non-container value except JSON string.", | ||
| " * Returns 0 if no array or object value is located by the path.", | ||
| " * Always Returns 1 if clearing a JSON string value regardless of the length of the JSON string value including empty string.", |
Member
There was a problem hiding this comment.
Suggested change
| " * Always Returns 1 if clearing a JSON string value regardless of the length of the JSON string value including empty string.", |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix a wrong and add a new