-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 a JsonObject.TryAdd
method.
#110244
Labels
api-approved
API was approved in API review, it can be implemented
area-System.Text.Json
in-pr
There is an active PR which will close this issue when it is merged
Milestone
Comments
dotnet-issue-labeler
bot
added
the
needs-area-label
An area label is needed to ensure this gets routed to the appropriate area owners
label
Nov 28, 2024
dotnet-policy-service
bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Nov 28, 2024
eiriktsarpalis
added
area-System.Text.Json
and removed
untriaged
New issue has not been triaged by the area owner
needs-area-label
An area label is needed to ensure this gets routed to the appropriate area owners
labels
Nov 28, 2024
eiriktsarpalis
changed the title
This workaround requires dual lookup if the key is missing, which suggests to me that a
Add a Nov 28, 2024
JsonObject.TryAdd
method similar to the one in https://github.com/dotnet/runtime/issues/107947 might be necessary.JsonObject.TryAdd
method.
eiriktsarpalis
added
the
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
label
Nov 28, 2024
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis |
eiriktsarpalis
added
api-ready-for-review
API is ready for review, it is NOT ready for implementation
and removed
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
labels
Nov 28, 2024
namespace System.Text.Json.Nodes;
public partial class JsonObject
{
public bool TryAdd(string propertyName, JsonNode? value);
public bool TryAdd(string propertyName, JsonNode? value, out int index);
public bool TryGetPropertyValue(string propertyName, out JsonNode? jsonNode, out int index);
} |
terrajobst
added
the
api-approved
API was approved in API review, it can be implemented
label
Dec 3, 2024
terrajobst
removed
the
api-ready-for-review
API is ready for review, it is NOT ready for implementation
label
Dec 6, 2024
Is there anybody working on this? If not, I can take a stab at it. |
@Flu go for it, thanks! |
dotnet-policy-service
bot
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jan 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api-approved
API was approved in API review, it can be implemented
area-System.Text.Json
in-pr
There is an active PR which will close this issue when it is merged
Originally posted by @eiriktsarpalis in dotnet/aspire#6312 (comment)
API Proposal
Exposing the APIs as approved for
OrderedDictionary
toJsonObject
:The text was updated successfully, but these errors were encountered: