Skip to content

JsonElement.GetJsonPointer Method

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: JsonElement.JsonPointer.cs

GetJsonPointer()

Gets the JSON Pointer (RFC 6901) of this element, relative to the root of its backing document, as a string.

public string GetJsonPointer()

Returns

string

The JSON Pointer. The root element produces the empty string.

Exceptions

Exception Description
InvalidOperationException This is a default JsonElement.
ObjectDisposedException The parent JsonDocument has been disposed.

Remarks

Property names are unescaped and then pointer-escaped (~ as ~0, / as ~1) per RFC 6901. The pointer is relative to the root of the document that backs this element. In a JsonWorkspace, an element obtained from another document referenced by a builder reports its location within that referenced document.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue