Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change {TValue} to {T} for consistency
  • Loading branch information
steveharter committed Jul 30, 2021
commit c9a2a15d7fc883ffe0a2df661ab1ff90d28f5f35
2 changes: 1 addition & 1 deletion src/libraries/System.Text.Json/ref/System.Text.Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ internal JsonNode() { }
public System.Text.Json.Nodes.JsonObject AsObject() { throw null; }
public System.Text.Json.Nodes.JsonValue AsValue() { throw null; }
public string GetPath() { throw null; }
public virtual TValue GetValue<TValue>() { throw null; }
public virtual T GetValue<T>() { throw null; }
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Seems fine to me?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. I don't think this needs an API review.

Copy link
Contributor Author

@steveharter steveharter Jul 30, 2021

Choose a reason for hiding this comment

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

Thanks (I was about to create a mail for this)

public static explicit operator bool (System.Text.Json.Nodes.JsonNode value) { throw null; }
public static explicit operator byte (System.Text.Json.Nodes.JsonNode value) { throw null; }
public static explicit operator char (System.Text.Json.Nodes.JsonNode value) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,22 @@ public JsonNode Root
/// Gets the value for the current <see cref="JsonValue"/>.
/// </summary>
/// <remarks>
/// {TValue} can be the type or base type of the underlying value.
/// If the underlying value is a <see cref="JsonElement"/> then {TValue} can also be the type of any primitive
/// value supported by current <see cref="JsonElement"/>.<br />
/// Specifying <see cref="object"/> will always succeed and return the underlying value as <see cref="object"/>.<br />
/// The underlying value of a <see cref="JsonValue"/> after deserialization is <see cref="JsonElement"/>,
/// otherwise it is the value specified when the <see cref="JsonValue"/> was created.
/// {T} can be the type or base type of the underlying value.
/// If the underlying value is a <see cref="JsonElement"/> then {T} can also be the type of any primitive
/// value supported by current <see cref="JsonElement"/>.
/// Specifying the <see cref="object"/> type for {T} will always succeed and return the underlying value as <see cref="object"/>.<br />
/// The underlying value of a <see cref="JsonValue"/> after deserialization is an instance of <see cref="JsonElement"/>,
/// otherwise it's the value specified when the <see cref="JsonValue"/> was created.
/// </remarks>
/// <seealso cref="JsonValue.TryGetValue{T}">
/// <seealso cref="System.Text.Json.Nodes.JsonValue.TryGetValue"></seealso>
/// <exception cref="FormatException">
/// The current <see cref="JsonNode"/> cannot be represented as a {TValue}.
/// The current <see cref="JsonNode"/> cannot be represented as a {T}.
/// </exception>
/// <exception cref="InvalidOperationException">
/// The current <see cref="JsonNode"/> is not a <see cref="JsonValue"/> or
/// is not compatible with {TValue}.
/// is not compatible with {T}.
/// </exception>
public virtual TValue GetValue<TValue>() =>
public virtual T GetValue<T>() =>
throw new InvalidOperationException(SR.Format(SR.NodeWrongType, nameof(JsonValue)));

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ internal override void GetPath(List<string> path, JsonNode? child)
/// <remarks>
/// {T} can be the type or base type of the underlying value.
/// If the underlying value is a <see cref="JsonElement"/> then {T} can also be the type of any primitive
/// value supported by current <see cref="JsonElement"/>.<br />
/// Specifying <see cref="object"/> will always succeed and return the underlying value as <see cref="object"/>.<br />
/// The underlying value of a <see cref="JsonValue"/> after deserialization is <see cref="JsonElement"/>,
/// otherwise it is the value specified when the <see cref="JsonValue"/> was created.
/// value supported by current <see cref="JsonElement"/>.
/// Specifying the <see cref="object"/> type for {T} will always succeed and return the underlying value as <see cref="object"/>.<br />
/// The underlying value of a <see cref="JsonValue"/> after deserialization is an instance of <see cref="JsonElement"/>,
/// otherwise it's the value specified when the <see cref="JsonValue"/> was created.
/// </remarks>
/// <seealso cref="JsonNode.GetValue{TValue}"></seealso>
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this also need renaming?

Suggested change
/// <seealso cref="JsonNode.GetValue{TValue}"></seealso>
/// <seealso cref="JsonNode.GetValue{T}"></seealso>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Thanks

/// <typeparam name="T">The type of value to obtain.</typeparam>
Expand Down