<PackageReference Include="NJsonSchema" Version="8.23.6298.10815" />

JsonPathUtilities

public static class JsonPathUtilities
Utilities to work with JSON paths.
public static string GetJsonPath(object rootObject, object searchedObject)

Gets the JSON path of the given object.