diff --git a/src/Providers.Core/Extensions/GremlinQueryEnvironmentExtensions.cs b/src/Providers.Core/Extensions/GremlinQueryEnvironmentExtensions.cs index 44a0cce403..1def40bc66 100644 --- a/src/Providers.Core/Extensions/GremlinQueryEnvironmentExtensions.cs +++ b/src/Providers.Core/Extensions/GremlinQueryEnvironmentExtensions.cs @@ -18,7 +18,12 @@ public static class GremlinQueryEnvironmentExtensions { private static readonly byte[] GraphSon2Header = GetHeader("application/vnd.gremlin-v2.0+json"); private static readonly byte[] GraphSon3Header = GetHeader("application/vnd.gremlin-v3.0+json"); - private static readonly JsonSerializerOptions JsonOptions = new() { Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; + + private static readonly JsonSerializerOptions JsonOptions = new() + { + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + MaxDepth = 128 + }; public static IGremlinQueryEnvironment AddGraphSonBinarySupport(this IGremlinQueryEnvironment environment) => environment .AddGraphSonBinarySupport(new GraphSON2Writer(), GraphSon2Header, owner => new GraphSon2BinaryMessage(owner)) diff --git a/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.MaxDepth.verified.txt b/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.MaxDepth.verified.txt index 885cd5556c..a54921723a 100644 --- a/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.MaxDepth.verified.txt +++ b/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.MaxDepth.verified.txt @@ -1 +1 @@ -!application/vnd.gremlin-v3.0+json{"requestId":"00000000-0000-0000-0000-000000000000","op":"bytecode","processor":"traversal","args":{"gremlin":{"@type":"g:Bytecode","@value":{"step":[["inject",{"@type":"g:Int32","@value":0}],["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int32","@value":1}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}},"aliases":{"g":"g"}}} \ No newline at end of file +!application/vnd.gremlin-v3.0+json{"requestId":"00000000-0000-0000-0000-000000000000","op":"bytecode","processor":"traversal","args":{"gremlin":{"@type":"g:Bytecode","@value":{"step":[["inject",{"@type":"g:Int32","@value":0}],["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["map",{"@type":"g:Bytecode","@value":{"step":[["constant",{"@type":"g:Int32","@value":1}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}}]]}},"aliases":{"g":"g"}}} \ No newline at end of file diff --git a/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.cs b/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.cs index 5a9be7a309..d41a071433 100644 --- a/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.cs +++ b/test/Core.Tests/Serialization/Graphson3BinaryMessageSerializationTest.cs @@ -18,7 +18,7 @@ public Task MaxDepth() { return _g .Inject(0) - .Map(GetLambda(13)) + .Map(GetLambda(29)) .Verify(); }