You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2021/04/28 14:19:46 UTC

[tinkerpop] branch TINKERPOP-2348 updated (00b9561 -> a100bc7)

This is an automated email from the ASF dual-hosted git repository.

florianhockmann pushed a change to branch TINKERPOP-2348
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


    from 00b9561  Enable nullable warnings for all GraphBinary types
     new 97f5b7e  Enable nullable warnings for GraphSON
     new 5aa418c  Enable nullable warnings for most types in Process
     new a100bc7  Enable nullable warnings for traversal types

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../Driver/Remote/DriverRemoteConnection.cs        |  4 +-
 .../Driver/Remote/DriverRemoteTraversal.cs         |  3 +
 .../Process/Remote/IRemoteConnection.cs            |  2 +
 .../Gremlin.Net/Process/Remote/RemoteStrategy.cs   |  2 +
 .../src/Gremlin.Net/Process/Traversal/Barrier.cs   |  4 +-
 .../src/Gremlin.Net/Process/Traversal/Bindings.cs  | 11 ++-
 .../src/Gremlin.Net/Process/Traversal/Bytecode.cs  | 21 +++--
 .../Gremlin.Net/Process/Traversal/Cardinality.cs   |  8 +-
 .../src/Gremlin.Net/Process/Traversal/Column.cs    |  6 +-
 .../Process/Traversal/ConnectedComponent.cs        | 12 +--
 .../Process/Traversal/DefaultTraversal.cs          | 56 ++++++++-----
 .../src/Gremlin.Net/Process/Traversal/Direction.cs |  8 +-
 .../Gremlin.Net/Process/Traversal/EnumWrapper.cs   |  9 ++-
 .../Process/Traversal/GraphSONVersion.cs           |  8 +-
 .../Process/Traversal/GraphTraversal.cs            | 77 ++++++++++--------
 .../Process/Traversal/GraphTraversalSource.cs      | 43 +++++-----
 .../Gremlin.Net/Process/Traversal/GryoVersion.cs   |  6 +-
 .../Gremlin.Net/Process/Traversal/IBiFunction.cs   |  2 +
 .../Process/Traversal/IBinaryOperator.cs           |  2 +
 .../Gremlin.Net/Process/Traversal/IComparator.cs   |  2 +
 .../src/Gremlin.Net/Process/Traversal/IConsumer.cs |  2 +
 .../src/Gremlin.Net/Process/Traversal/IFunction.cs |  2 +
 .../src/Gremlin.Net/Process/Traversal/IO.cs        | 14 ++--
 .../Gremlin.Net/Process/Traversal/IPredicate.cs    |  2 +
 .../src/Gremlin.Net/Process/Traversal/ISupplier.cs |  2 +
 .../Gremlin.Net/Process/Traversal/ITraversal.cs    | 14 ++--
 .../Process/Traversal/ITraversalStrategy.cs        |  2 +
 .../Process/Traversal/IUnaryOperator.cs            |  2 +
 .../Gremlin.Net/Process/Traversal/Instruction.cs   | 23 +++---
 .../src/Gremlin.Net/Process/Traversal/Lambda.cs    |  2 +
 .../Process/Traversal/NamingConversions.cs         | 91 ----------------------
 .../src/Gremlin.Net/Process/Traversal/Operator.cs  | 24 +++---
 .../src/Gremlin.Net/Process/Traversal/Order.cs     |  8 +-
 .../src/Gremlin.Net/Process/Traversal/PageRank.cs  | 12 +--
 .../Gremlin.Net/Process/Traversal/PeerPressure.cs  | 12 +--
 .../src/Gremlin.Net/Process/Traversal/Pick.cs      |  6 +-
 .../src/Gremlin.Net/Process/Traversal/Pop.cs       | 10 ++-
 .../src/Gremlin.Net/Process/Traversal/Scope.cs     |  6 +-
 .../Gremlin.Net/Process/Traversal/ShortestPath.cs  | 16 ++--
 .../Strategy/AbstractTraversalStrategy.cs          |  8 +-
 .../Strategy/Decoration/OptionsStrategy.cs         |  2 +
 .../Strategy/Decoration/VertexProgramStrategy.cs   |  8 +-
 .../Process/Traversal/StringBasedLambda.cs         |  2 +
 .../src/Gremlin.Net/Process/Traversal/T.cs         | 10 ++-
 .../Gremlin.Net/Process/Traversal/WithOptions.cs   |  8 +-
 .../src/Gremlin.Net/Process/Traversal/__.cs        | 23 +++---
 gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs    |  4 +-
 .../IO/GraphBinary/Types/PathSerializer.cs         |  2 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs          |  4 +
 .../Structure/IO/GraphSON/BigIntegerSerializer.cs  |  2 +
 .../Structure/IO/GraphSON/BindingSerializer.cs     |  4 +-
 .../Structure/IO/GraphSON/BulkSetSerializer.cs     |  4 +-
 .../IO/GraphSON/ByteBufferDeserializer.cs          |  4 +-
 .../Structure/IO/GraphSON/ByteBufferSerializer.cs  |  2 +
 .../Structure/IO/GraphSON/ByteConverter.cs         |  2 +
 .../Structure/IO/GraphSON/BytecodeSerializer.cs    |  2 +
 .../Structure/IO/GraphSON/CharConverter.cs         |  5 +-
 .../Structure/IO/GraphSON/ClassSerializer.cs       | 12 ++-
 .../Structure/IO/GraphSON/DateDeserializer.cs      |  4 +-
 .../Structure/IO/GraphSON/DateSerializer.cs        |  2 +
 .../Structure/IO/GraphSON/DecimalConverter.cs      |  8 +-
 .../Structure/IO/GraphSON/DirectionDeserializer.cs |  7 +-
 .../Structure/IO/GraphSON/DurationDeserializer.cs  |  6 +-
 .../Structure/IO/GraphSON/DurationSerializer.cs    |  2 +
 .../Structure/IO/GraphSON/EdgeDeserializer.cs      |  2 +
 .../Structure/IO/GraphSON/EdgeSerializer.cs        |  2 +
 .../Structure/IO/GraphSON/EnumSerializer.cs        |  2 +
 .../Structure/IO/GraphSON/FloatConverter.cs        |  2 +
 .../IO/GraphSON/GraphSON2MessageSerializer.cs      |  4 +-
 .../Structure/IO/GraphSON/GraphSON2Reader.cs       |  2 +
 .../Structure/IO/GraphSON/GraphSON2Writer.cs       |  2 +
 .../Structure/IO/GraphSON/GraphSON3Reader.cs       |  2 +
 .../Structure/IO/GraphSON/GraphSON3Writer.cs       |  2 +
 .../IO/GraphSON/GraphSONMessageSerializer.cs       |  7 +-
 .../Structure/IO/GraphSON/GraphSONReader.cs        | 16 ++--
 .../Structure/IO/GraphSON/GraphSONTokens.cs        |  8 +-
 .../Structure/IO/GraphSON/GraphSONUtil.cs          |  9 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs        | 15 ++--
 .../Structure/IO/GraphSON/IGraphSONDeserializer.cs |  4 +-
 .../Structure/IO/GraphSON/IGraphSONSerializer.cs   |  2 +
 .../Structure/IO/GraphSON/Int16Converter.cs        |  2 +
 .../Structure/IO/GraphSON/Int32Converter.cs        |  2 +
 .../Structure/IO/GraphSON/Int64Converter.cs        |  2 +
 .../Structure/IO/GraphSON/LambdaSerializer.cs      |  2 +
 .../Structure/IO/GraphSON/ListSerializer.cs        |  4 +-
 .../Structure/IO/GraphSON/MapSerializer.cs         |  8 +-
 .../Structure/IO/GraphSON/NumberConverter.cs       |  3 +
 .../Structure/IO/GraphSON/PSerializer.cs           |  2 +
 .../Structure/IO/GraphSON/Path3Deserializer.cs     | 11 ++-
 .../Structure/IO/GraphSON/PathDeserializer.cs      |  6 +-
 .../Structure/IO/GraphSON/PropertyDeserializer.cs  |  2 +
 .../Structure/IO/GraphSON/PropertySerializer.cs    | 10 ++-
 .../IO/GraphSON/RequestMessageSerializer.cs        |  2 +
 .../Structure/IO/GraphSON/SetSerializer.cs         |  4 +-
 .../Structure/IO/GraphSON/TDeserializer.cs         |  6 +-
 .../Structure/IO/GraphSON/TextPSerializer.cs       |  2 +
 .../Structure/IO/GraphSON/TraversalSerializer.cs   | 11 ++-
 .../IO/GraphSON/TraversalStrategySerializer.cs     |  2 +
 .../Structure/IO/GraphSON/TraverserReader.cs       |  2 +
 .../Structure/IO/GraphSON/UuidDeserializer.cs      |  6 +-
 .../Structure/IO/GraphSON/UuidSerializer.cs        |  2 +
 .../Structure/IO/GraphSON/VertexDeserializer.cs    |  2 +
 .../IO/GraphSON/VertexPropertyDeserializer.cs      |  2 +
 .../IO/GraphSON/VertexPropertySerializer.cs        |  9 ++-
 .../Structure/IO/GraphSON/VertexSerializer.cs      |  2 +
 gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs   | 23 +++---
 .../Gherkin/GherkinTestRunner.cs                   |  2 +-
 .../Process/Remote/RemoteStrategyTests.cs          |  2 +
 .../Driver/GraphSONMessageSerializerTests.cs       | 15 ++--
 .../Process/Traversal/GraphTraversalTests.cs}      | 14 ++--
 .../Process/Traversal/TestTraversal.cs             |  2 +
 .../IO/GraphSON/BytecodeGraphSONSerializerTests.cs |  2 +
 .../Structure/IO/GraphSON/GraphSONWriterTests.cs   | 13 ++++
 113 files changed, 556 insertions(+), 377 deletions(-)
 delete mode 100644 gremlin-dotnet/src/Gremlin.Net/Process/Traversal/NamingConversions.cs
 copy gremlin-dotnet/{src/Gremlin.Net/Structure/IO/GraphSON/DirectionDeserializer.cs => test/Gremlin.Net.UnitTest/Process/Traversal/GraphTraversalTests.cs} (73%)

[tinkerpop] 03/03: Enable nullable warnings for traversal types

Posted by fl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

florianhockmann pushed a commit to branch TINKERPOP-2348
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit a100bc76231eb7369055554ad7f60d55b4415f6a
Author: Florian Hockmann <fh...@florian-hockmann.de>
AuthorDate: Wed Apr 28 16:19:04 2021 +0200

    Enable nullable warnings for traversal types
---
 .../Process/Traversal/DefaultTraversal.cs          |  2 +-
 .../Process/Traversal/GraphTraversal.cs            | 77 ++++++++++++----------
 .../Process/Traversal/GraphTraversalSource.cs      | 43 ++++++------
 .../Strategy/AbstractTraversalStrategy.cs          |  8 ++-
 .../Strategy/Decoration/OptionsStrategy.cs         |  2 +
 .../Strategy/Decoration/VertexProgramStrategy.cs   |  8 ++-
 .../src/Gremlin.Net/Process/Traversal/__.cs        | 23 ++++---
 .../Process/Remote/RemoteStrategyTests.cs          |  2 +
 .../Process/Traversal/TestTraversal.cs             |  2 +
 .../IO/GraphSON/BytecodeGraphSONSerializerTests.cs |  2 +
 10 files changed, 99 insertions(+), 70 deletions(-)

diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
index 8348035..61c0b14 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
@@ -42,7 +42,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Gets the <see cref="Traversal.Bytecode" /> representation of this traversal.
         /// </summary>
-        public virtual Bytecode Bytecode { get; protected set; } = null!;
+        public abstract Bytecode Bytecode { get; }
         
         /// <summary>
         ///     Determines if this traversal was spawned anonymously or not.
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs
index 8f6df56..93bf326 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Linq;
 using Gremlin.Net.Structure;
@@ -62,12 +64,15 @@ namespace Gremlin.Net.Process.Traversal
             Bytecode = bytecode;
             IsAnonymous = anonymous;
         }
+        
+        /// <inheritdoc />
+        public override Bytecode Bytecode { get; }
 
         private static GraphTraversal<S2, E2> Wrap<S2, E2>(GraphTraversal<S, E> traversal)
         {
             if (typeof(S2) == typeof(S) && typeof(E2) == typeof(E))
             {
-                return traversal as GraphTraversal<S2, E2>;
+                return (traversal as GraphTraversal<S2, E2>)!;
             }
             // New wrapper
             return new GraphTraversal<S2, E2>(traversal.TraversalStrategies, traversal.Bytecode, traversal.IsAnonymous);
@@ -77,9 +82,9 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the V step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, Vertex> V (params object[] vertexIdsOrElements)
+        public GraphTraversal<S, Vertex> V (params object?[] vertexIdsOrElements)
         {
-            var args = new List<object>(0 + vertexIdsOrElements.Length) {};
+            var args = new List<object?>(0 + vertexIdsOrElements.Length);
             args.AddRange(vertexIdsOrElements);
             Bytecode.AddStep("V", args.ToArray());
             return Wrap<S, Vertex>(this);
@@ -502,7 +507,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, IDictionary<object, E2>> ElementMap<E2> (params string[] propertyKeys)
         {
-            var args = new List<object>(0 + propertyKeys.Length) {};
+            var args = new List<object>(0 + propertyKeys.Length);
             args.AddRange(propertyKeys);
             Bytecode.AddStep("elementMap", args.ToArray());
             return Wrap<S, IDictionary<object, E2>>(this);
@@ -664,7 +669,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the has step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> Has (string propertyKey, object value)
+        public GraphTraversal<S, E> Has (string propertyKey, object? value)
         {
             Bytecode.AddStep("has", propertyKey, value);
             return Wrap<S, E>(this);
@@ -682,7 +687,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the has step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> Has (string label, string propertyKey, object value)
+        public GraphTraversal<S, E> Has (string label, string propertyKey, object? value)
         {
             Bytecode.AddStep("has", label, propertyKey, value);
             return Wrap<S, E>(this);
@@ -709,7 +714,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the has step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> Has (T accessor, object value)
+        public GraphTraversal<S, E> Has (T accessor, object? value)
         {
             Bytecode.AddStep("has", accessor, value);
             return Wrap<S, E>(this);
@@ -736,9 +741,9 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the hasId step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> HasId (object id, params object[] otherIds)
+        public GraphTraversal<S, E> HasId (object? id, params object?[] otherIds)
         {
-            var args = new List<object>(1 + otherIds.Length) {id};
+            var args = new List<object?>(1 + otherIds.Length) {id};
             args.AddRange(otherIds);
             Bytecode.AddStep("hasId", args.ToArray());
             return Wrap<S, E>(this);
@@ -805,9 +810,9 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the hasValue step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> HasValue (object value, params object[] otherValues)
+        public GraphTraversal<S, E> HasValue (object? value, params object?[] otherValues)
         {
-            var args = new List<object>(1 + otherValues.Length) {value};
+            var args = new List<object?>(1 + otherValues.Length) {value};
             args.AddRange(otherValues);
             Bytecode.AddStep("hasValue", args.ToArray());
             return Wrap<S, E>(this);
@@ -825,10 +830,10 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the id step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, object> Id ()
+        public GraphTraversal<S, object?> Id ()
         {
             Bytecode.AddStep("id");
-            return Wrap<S, object>(this);
+            return Wrap<S, object?>(this);
         }
 
         /// <summary>
@@ -845,7 +850,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, Vertex> In (params string[] edgeLabels)
         {
-            var args = new List<object>(0 + edgeLabels.Length) {};
+            var args = new List<object>(0 + edgeLabels.Length);
             args.AddRange(edgeLabels);
             Bytecode.AddStep("in", args.ToArray());
             return Wrap<S, Vertex>(this);
@@ -856,7 +861,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, Edge> InE (params string[] edgeLabels)
         {
-            var args = new List<object>(0 + edgeLabels.Length) {};
+            var args = new List<object>(0 + edgeLabels.Length);
             args.AddRange(edgeLabels);
             Bytecode.AddStep("inE", args.ToArray());
             return Wrap<S, Edge>(this);
@@ -885,7 +890,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, E> Inject (params E[] injections)
         {
-            var args = new List<object>(0 + injections.Length) {};
+            var args = new List<object>(0 + injections.Length);
             args.AddRange(injections.Cast<object>());
             Bytecode.AddStep("inject", args.ToArray());
             return Wrap<S, E>(this);
@@ -894,7 +899,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the is step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> Is (object value)
+        public GraphTraversal<S, E> Is (object? value)
         {
             Bytecode.AddStep("is", value);
             return Wrap<S, E>(this);
@@ -995,7 +1000,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, IDictionary<string, E2>> Match<E2> (params ITraversal[] matchTraversals)
         {
-            var args = new List<object>(0 + matchTraversals.Length) {};
+            var args = new List<object>(0 + matchTraversals.Length);
             args.AddRange(matchTraversals);
             Bytecode.AddStep("match", args.ToArray());
             return Wrap<S, IDictionary<string, E2>>(this);
@@ -1114,7 +1119,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, E> Or (params ITraversal[] orTraversals)
         {
-            var args = new List<object>(0 + orTraversals.Length) {};
+            var args = new List<object>(0 + orTraversals.Length);
             args.AddRange(orTraversals);
             Bytecode.AddStep("or", args.ToArray());
             return Wrap<S, E>(this);
@@ -1152,7 +1157,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, Vertex> Out (params string[] edgeLabels)
         {
-            var args = new List<object>(0 + edgeLabels.Length) {};
+            var args = new List<object>(0 + edgeLabels.Length);
             args.AddRange(edgeLabels);
             Bytecode.AddStep("out", args.ToArray());
             return Wrap<S, Vertex>(this);
@@ -1163,7 +1168,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, Edge> OutE (params string[] edgeLabels)
         {
-            var args = new List<object>(0 + edgeLabels.Length) {};
+            var args = new List<object>(0 + edgeLabels.Length);
             args.AddRange(edgeLabels);
             Bytecode.AddStep("outE", args.ToArray());
             return Wrap<S, Edge>(this);
@@ -1257,7 +1262,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, E2> Properties<E2> (params string[] propertyKeys)
         {
-            var args = new List<object>(0 + propertyKeys.Length) {};
+            var args = new List<object>(0 + propertyKeys.Length);
             args.AddRange(propertyKeys);
             Bytecode.AddStep("properties", args.ToArray());
             return Wrap<S, E2>(this);
@@ -1266,9 +1271,10 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the property step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> Property (Cardinality cardinality, object key, object value, params object[] keyValues)
+        public GraphTraversal<S, E> Property(Cardinality cardinality, object key, object? value,
+            params object?[] keyValues)
         {
-            var args = new List<object>(3 + keyValues.Length) {cardinality, key, value};
+            var args = new List<object?>(3 + keyValues.Length) {cardinality, key, value};
             args.AddRange(keyValues);
             Bytecode.AddStep("property", args.ToArray());
             return Wrap<S, E>(this);
@@ -1277,9 +1283,9 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the property step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, E> Property (object key, object value, params object[] keyValues)
+        public GraphTraversal<S, E> Property (object key, object? value, params object?[] keyValues)
         {
-            var args = new List<object>(2 + keyValues.Length) {key, value};
+            var args = new List<object?>(2 + keyValues.Length) {key, value};
             args.AddRange(keyValues);
             Bytecode.AddStep("property", args.ToArray());
             return Wrap<S, E>(this);
@@ -1290,7 +1296,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, IDictionary<string, E2>> PropertyMap<E2> (params string[] propertyKeys)
         {
-            var args = new List<object>(0 + propertyKeys.Length) {};
+            var args = new List<object>(0 + propertyKeys.Length);
             args.AddRange(propertyKeys);
             Bytecode.AddStep("propertyMap", args.ToArray());
             return Wrap<S, IDictionary<string, E2>>(this);
@@ -1398,7 +1404,8 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the select step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, IDictionary<string, E2>> Select<E2> (Pop pop, string selectKey1, string selectKey2, params string[] otherSelectKeys)
+        public GraphTraversal<S, IDictionary<string, E2>> Select<E2>(Pop pop, string selectKey1, string selectKey2,
+            params string[] otherSelectKeys)
         {
             var args = new List<object>(3 + otherSelectKeys.Length) {pop, selectKey1, selectKey2};
             args.AddRange(otherSelectKeys);
@@ -1427,7 +1434,8 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the select step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, IDictionary<string, E2>> Select<E2> (string selectKey1, string selectKey2, params string[] otherSelectKeys)
+        public GraphTraversal<S, IDictionary<string, E2>> Select<E2>(string selectKey1, string selectKey2,
+            params string[] otherSelectKeys)
         {
             var args = new List<object>(2 + otherSelectKeys.Length) {selectKey1, selectKey2};
             args.AddRange(otherSelectKeys);
@@ -1678,7 +1686,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, E2> Union<E2> (params ITraversal[] unionTraversals)
         {
-            var args = new List<object>(0 + unionTraversals.Length) {};
+            var args = new List<object>(0 + unionTraversals.Length);
             args.AddRange(unionTraversals);
             Bytecode.AddStep("union", args.ToArray());
             return Wrap<S, E2>(this);
@@ -1716,7 +1724,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, IDictionary<TKey, TValue>> ValueMap<TKey, TValue> (params string[] propertyKeys)
         {
-            var args = new List<object>(0 + propertyKeys.Length) {};
+            var args = new List<object>(0 + propertyKeys.Length);
             args.AddRange(propertyKeys);
             Bytecode.AddStep("valueMap", args.ToArray());
             return Wrap<S, IDictionary<TKey, TValue>>(this);
@@ -1725,7 +1733,8 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Adds the valueMap step to this <see cref="GraphTraversal{SType, EType}" />.
         /// </summary>
-        public GraphTraversal<S, IDictionary<TKey, TValue>> ValueMap<TKey, TValue> (bool includeTokens, params string[] propertyKeys)
+        public GraphTraversal<S, IDictionary<TKey, TValue>> ValueMap<TKey, TValue>(bool includeTokens,
+            params string[] propertyKeys)
         {
             var args = new List<object>(1 + propertyKeys.Length) {includeTokens};
             args.AddRange(propertyKeys);
@@ -1738,7 +1747,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, E2> Values<E2> (params string[] propertyKeys)
         {
-            var args = new List<object>(0 + propertyKeys.Length) {};
+            var args = new List<object>(0 + propertyKeys.Length);
             args.AddRange(propertyKeys);
             Bytecode.AddStep("values", args.ToArray());
             return Wrap<S, E2>(this);
@@ -1804,7 +1813,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public GraphTraversal<S, E> Clone()
         {
-            return new GraphTraversal<S, E>(TraversalStrategies, new Bytecode(Bytecode));
+            return new(TraversalStrategies, new Bytecode(Bytecode));
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs
index db4c521..21b2295 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -89,7 +91,7 @@ namespace Gremlin.Net.Process.Traversal
                 return WithStrategies(optionsStrategy);
             }
 
-            optionsStrategy = optionsStrategyInst.Arguments[0];
+            optionsStrategy = optionsStrategyInst.Arguments[0]!;
             optionsStrategy.Configuration[key] = value;
             return new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                 new Bytecode(Bytecode));
@@ -112,7 +114,7 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSack(object initialValue)
+        public GraphTraversalSource WithSack(object? initialValue)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -120,7 +122,7 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSack(object initialValue, IBinaryOperator mergeOperator)
+        public GraphTraversalSource WithSack(object? initialValue, IBinaryOperator mergeOperator)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -128,7 +130,7 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSack(object initialValue, IUnaryOperator splitOperator)
+        public GraphTraversalSource WithSack(object? initialValue, IUnaryOperator splitOperator)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -136,7 +138,8 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSack(object initialValue, IUnaryOperator splitOperator, IBinaryOperator mergeOperator)
+        public GraphTraversalSource WithSack(object? initialValue, IUnaryOperator splitOperator,
+            IBinaryOperator mergeOperator)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -168,7 +171,8 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSack(ISupplier initialValue, IUnaryOperator splitOperator, IBinaryOperator mergeOperator)
+        public GraphTraversalSource WithSack(ISupplier initialValue, IUnaryOperator splitOperator,
+            IBinaryOperator mergeOperator)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -176,7 +180,7 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSideEffect(string key, object initialValue)
+        public GraphTraversalSource WithSideEffect(string key, object? initialValue)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -184,7 +188,7 @@ namespace Gremlin.Net.Process.Traversal
             return source;
         }
 
-        public GraphTraversalSource WithSideEffect(string key, object initialValue, IBinaryOperator reducer)
+        public GraphTraversalSource WithSideEffect(string key, object? initialValue, IBinaryOperator reducer)
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
@@ -212,7 +216,7 @@ namespace Gremlin.Net.Process.Traversal
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
-            var args = new List<object>(0 + traversalStrategies.Length) {};
+            var args = new List<object>(0 + traversalStrategies.Length);
             args.AddRange(traversalStrategies);
             source.Bytecode.AddSource("withStrategies", args.ToArray());
             return source;
@@ -222,7 +226,7 @@ namespace Gremlin.Net.Process.Traversal
         {
             var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies),
                                                   new Bytecode(Bytecode));
-            var args = new List<object>(0 + traversalStrategyClasses.Length) {};
+            var args = new List<object>(0 + traversalStrategyClasses.Length);
             args.AddRange(traversalStrategyClasses);
             source.Bytecode.AddSource("withoutStrategies", args.ToArray());
             return source;
@@ -255,11 +259,12 @@ namespace Gremlin.Net.Process.Traversal
         ///     Add a GraphComputer class used to execute the traversal.
         ///     This adds a <see cref="VertexProgramStrategy" /> to the strategies.
         /// </summary>
-        public GraphTraversalSource WithComputer(string graphComputer = null, int? workers = null, string persist = null,
-            string result = null, ITraversal vertices = null, ITraversal edges = null,
-            Dictionary<string, dynamic> configuration = null)
+        public GraphTraversalSource WithComputer(string? graphComputer = null, int? workers = null,
+            string? persist = null, string? result = null, ITraversal? vertices = null, ITraversal? edges = null,
+            Dictionary<string, dynamic>? configuration = null)
         {
-            return WithStrategies(new VertexProgramStrategy(graphComputer, workers, persist, result, vertices, edges, configuration));
+            return WithStrategies(new VertexProgramStrategy(graphComputer, workers, persist, result, vertices, edges,
+                configuration));
         }
 
 
@@ -267,10 +272,10 @@ namespace Gremlin.Net.Process.Traversal
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the E step to that
         ///     traversal.
         /// </summary>
-        public GraphTraversal<Edge, Edge> E(params object[] edgesIds)
+        public GraphTraversal<Edge, Edge> E(params object?[] edgesIds)
         {
             var traversal = new GraphTraversal<Edge, Edge>(TraversalStrategies, new Bytecode(Bytecode));
-            var args = new List<object>(0 + edgesIds.Length) {};
+            var args = new List<object?>(0 + edgesIds.Length);
             args.AddRange(edgesIds);
             traversal.Bytecode.AddStep("E", args.ToArray());
             return traversal;
@@ -280,10 +285,10 @@ namespace Gremlin.Net.Process.Traversal
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the V step to that
         ///     traversal.
         /// </summary>
-        public GraphTraversal<Vertex, Vertex> V(params object[] vertexIds)
+        public GraphTraversal<Vertex, Vertex> V(params object?[] vertexIds)
         {
             var traversal = new GraphTraversal<Vertex, Vertex>(TraversalStrategies, new Bytecode(Bytecode));
-            var args = new List<object>(0 + vertexIds.Length) {};
+            var args = new List<object?>(0 + vertexIds.Length) {};
             args.AddRange(vertexIds);
             traversal.Bytecode.AddStep("V", args.ToArray());
             return traversal;
@@ -351,7 +356,7 @@ namespace Gremlin.Net.Process.Traversal
         public GraphTraversal<S, S> Inject<S>(params S[] starts)
         {
             var traversal = new GraphTraversal<S, S>(TraversalStrategies, new Bytecode(Bytecode));
-            var args = new List<object>(0 + starts.Length) {};
+            var args = new List<object>(0 + starts.Length);
             args.AddRange(starts.Cast<object>());
             traversal.Bytecode.AddStep("inject", args.ToArray());
             return traversal;
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/AbstractTraversalStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/AbstractTraversalStrategy.cs
index 418ac7e..c0d853c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/AbstractTraversalStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/AbstractTraversalStrategy.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 using System.Threading.Tasks;
@@ -83,10 +85,10 @@ namespace Gremlin.Net.Process.Traversal.Strategy
         /// <summary>
         ///     Gets the configuration of the strategy.
         /// </summary>
-        public Dictionary<string, dynamic> Configuration { get; } = new Dictionary<string, dynamic>();
+        public Dictionary<string, dynamic> Configuration { get; } = new();
 
         /// <inheritdoc />
-        public bool Equals(AbstractTraversalStrategy other)
+        public bool Equals(AbstractTraversalStrategy? other)
         {
             if (ReferenceEquals(null, other)) return false;
             if (ReferenceEquals(this, other)) return true;
@@ -105,7 +107,7 @@ namespace Gremlin.Net.Process.Traversal.Strategy
         }
 
         /// <inheritdoc />
-        public override bool Equals(object obj)
+        public override bool Equals(object? obj)
         {
             if (ReferenceEquals(null, obj)) return false;
             if (ReferenceEquals(this, obj)) return true;
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs
index aee9118..2d9854f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/OptionsStrategy.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Process.Traversal.Strategy.Decoration
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/VertexProgramStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/VertexProgramStrategy.cs
index 17bfbaa..2850b8c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/VertexProgramStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Strategy/Decoration/VertexProgramStrategy.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Linq;
 
@@ -35,9 +37,9 @@ namespace Gremlin.Net.Process.Traversal.Strategy.Decoration
         {
         }
 
-        public VertexProgramStrategy(string graphComputer = null, int? workers = null, string persist = null,
-            string result = null, ITraversal vertices = null, ITraversal edges = null,
-            Dictionary<string, dynamic> configuration = null)
+        public VertexProgramStrategy(string? graphComputer = null, int? workers = null, string? persist = null,
+            string? result = null, ITraversal? vertices = null, ITraversal? edges = null,
+            Dictionary<string, dynamic>? configuration = null)
             : this()
         {
             if (graphComputer != null)
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs
index fa1c027..9827d30 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Structure;
 
@@ -36,7 +38,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         public static GraphTraversal<object, object> Start()
         {
-            return new GraphTraversal<object, object>();
+            return new();
         }
 
         /// <summary>
@@ -454,7 +456,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the has step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Has(string propertyKey, object value)
+        public static GraphTraversal<object, object> Has(string propertyKey, object? value)
         {
             return new GraphTraversal<object, object>().Has(propertyKey, value);            
         }
@@ -470,7 +472,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the has step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Has(string label, string propertyKey, object value)
+        public static GraphTraversal<object, object> Has(string label, string propertyKey, object? value)
         {
             return new GraphTraversal<object, object>().Has(label, propertyKey, value);            
         }
@@ -494,7 +496,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the has step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Has(T accessor, object value)
+        public static GraphTraversal<object, object> Has(T accessor, object? value)
         {
             return new GraphTraversal<object, object>().Has(accessor, value);            
         }
@@ -518,7 +520,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the hasId step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> HasId(object id, params object[] otherIds)
+        public static GraphTraversal<object, object> HasId(object? id, params object?[] otherIds)
         {
             return otherIds.Length == 0
                 ? new GraphTraversal<object, object>().HasId(id)
@@ -580,7 +582,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the hasValue step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> HasValue(object value, params object[] values)
+        public static GraphTraversal<object, object> HasValue(object? value, params object?[] values)
         {
             return values.Length == 0
                 ? new GraphTraversal<object, object>().HasValue(value)
@@ -598,7 +600,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the id step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Id()
+        public static GraphTraversal<object, object?> Id()
         {
             return new GraphTraversal<object, object>().Id();            
         }
@@ -660,7 +662,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the is step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Is(object value)
+        public static GraphTraversal<object, object> Is(object? value)
         {
             return new GraphTraversal<object, object>().Is(value);            
         }
@@ -920,7 +922,8 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the property step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Property(Cardinality cardinality, object key, object value, params object[] keyValues)
+        public static GraphTraversal<object, object> Property(Cardinality cardinality, object key, object? value,
+            params object?[] keyValues)
         {
             return keyValues.Length == 0
                 ? new GraphTraversal<object, object>().Property(cardinality, key, value)
@@ -930,7 +933,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Spawns a <see cref="GraphTraversal{SType, EType}" /> and adds the property step to that traversal.
         /// </summary>
-        public static GraphTraversal<object, object> Property(object key, object value, params object[] keyValues)
+        public static GraphTraversal<object, object> Property(object key, object? value, params object?[] keyValues)
         {
             return keyValues.Length == 0
                 ? new GraphTraversal<object, object>().Property(key, value)
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
index 5c24346..2e8839a 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Remote/RemoteStrategyTests.cs
@@ -93,5 +93,7 @@ namespace Gremlin.Net.IntegrationTest.Process.Remote
             TraversalStrategies.Add(traversalStrategy);
             Bytecode = bytecode;
         }
+
+        public override Bytecode Bytecode { get; }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/TestTraversal.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/TestTraversal.cs
index c1b87a0..e7cfa3d 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/TestTraversal.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/TestTraversal.cs
@@ -49,5 +49,7 @@ namespace Gremlin.Net.UnitTest.Process.Traversal
         {
             TraversalStrategies = traversalStrategies;
         }
+
+        public override Bytecode Bytecode { get; }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/BytecodeGraphSONSerializerTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/BytecodeGraphSONSerializerTests.cs
index ad78334..da6a6a7 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/BytecodeGraphSONSerializerTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/BytecodeGraphSONSerializerTests.cs
@@ -163,5 +163,7 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             Bytecode = bytecode;
             IsAnonymous = true;
         }
+
+        public override Bytecode Bytecode { get; }
     }
 }
\ No newline at end of file

[tinkerpop] 02/03: Enable nullable warnings for most types in Process

Posted by fl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

florianhockmann pushed a commit to branch TINKERPOP-2348
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 5aa418cbb9fa8214e1de711c2843b06e930e5712
Author: Florian Hockmann <fh...@florian-hockmann.de>
AuthorDate: Wed Apr 28 15:33:07 2021 +0200

    Enable nullable warnings for most types in Process
---
 .../Driver/Remote/DriverRemoteConnection.cs        |  4 +-
 .../Driver/Remote/DriverRemoteTraversal.cs         |  3 +
 .../Process/Remote/IRemoteConnection.cs            |  2 +
 .../Gremlin.Net/Process/Remote/RemoteStrategy.cs   |  2 +
 .../src/Gremlin.Net/Process/Traversal/Barrier.cs   |  4 +-
 .../src/Gremlin.Net/Process/Traversal/Bindings.cs  | 11 ++-
 .../src/Gremlin.Net/Process/Traversal/Bytecode.cs  | 21 +++--
 .../Gremlin.Net/Process/Traversal/Cardinality.cs   |  8 +-
 .../src/Gremlin.Net/Process/Traversal/Column.cs    |  6 +-
 .../Process/Traversal/ConnectedComponent.cs        | 12 +--
 .../Process/Traversal/DefaultTraversal.cs          | 56 ++++++++-----
 .../src/Gremlin.Net/Process/Traversal/Direction.cs |  8 +-
 .../Gremlin.Net/Process/Traversal/EnumWrapper.cs   |  9 ++-
 .../Process/Traversal/GraphSONVersion.cs           |  8 +-
 .../Gremlin.Net/Process/Traversal/GryoVersion.cs   |  6 +-
 .../Gremlin.Net/Process/Traversal/IBiFunction.cs   |  2 +
 .../Process/Traversal/IBinaryOperator.cs           |  2 +
 .../Gremlin.Net/Process/Traversal/IComparator.cs   |  2 +
 .../src/Gremlin.Net/Process/Traversal/IConsumer.cs |  2 +
 .../src/Gremlin.Net/Process/Traversal/IFunction.cs |  2 +
 .../src/Gremlin.Net/Process/Traversal/IO.cs        | 14 ++--
 .../Gremlin.Net/Process/Traversal/IPredicate.cs    |  2 +
 .../src/Gremlin.Net/Process/Traversal/ISupplier.cs |  2 +
 .../Gremlin.Net/Process/Traversal/ITraversal.cs    | 14 ++--
 .../Process/Traversal/ITraversalStrategy.cs        |  2 +
 .../Process/Traversal/IUnaryOperator.cs            |  2 +
 .../Gremlin.Net/Process/Traversal/Instruction.cs   | 23 +++---
 .../src/Gremlin.Net/Process/Traversal/Lambda.cs    |  2 +
 .../Process/Traversal/NamingConversions.cs         | 91 ----------------------
 .../src/Gremlin.Net/Process/Traversal/Operator.cs  | 24 +++---
 .../src/Gremlin.Net/Process/Traversal/Order.cs     |  8 +-
 .../src/Gremlin.Net/Process/Traversal/PageRank.cs  | 12 +--
 .../Gremlin.Net/Process/Traversal/PeerPressure.cs  | 12 +--
 .../src/Gremlin.Net/Process/Traversal/Pick.cs      |  6 +-
 .../src/Gremlin.Net/Process/Traversal/Pop.cs       | 10 ++-
 .../src/Gremlin.Net/Process/Traversal/Scope.cs     |  6 +-
 .../Gremlin.Net/Process/Traversal/ShortestPath.cs  | 16 ++--
 .../Process/Traversal/StringBasedLambda.cs         |  2 +
 .../src/Gremlin.Net/Process/Traversal/T.cs         | 10 ++-
 .../Gremlin.Net/Process/Traversal/WithOptions.cs   |  8 +-
 gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs    |  4 +-
 .../Process/Traversal/GraphTraversalTests.cs}      | 14 ++--
 42 files changed, 213 insertions(+), 241 deletions(-)

diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
index 30ff97b..c433a7f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
@@ -98,7 +98,7 @@ namespace Gremlin.Net.Driver.Remote
                 s => s.OperatorName == "withStrategies" && s.Arguments[0] is OptionsStrategy);
             if (optionsStrategyInst != null)
             {
-                OptionsStrategy optionsStrategy = optionsStrategyInst.Arguments[0];
+                OptionsStrategy optionsStrategy = optionsStrategyInst.Arguments[0]!;
                 foreach (var pair in optionsStrategy.Configuration)
                 {
                     if (_allowedKeys.Contains(pair.Key))
@@ -107,7 +107,7 @@ namespace Gremlin.Net.Driver.Remote
                     }
                 }
             }
-            
+
             return await _client.SubmitAsync<Traverser>(requestMsg.Create()).ConfigureAwait(false);
         }
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs
index ea375bd..c3954d8 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs
@@ -21,6 +21,7 @@
 
 #endregion
 
+using System;
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal;
 
@@ -32,5 +33,7 @@ namespace Gremlin.Net.Driver.Remote
         {
             Traversers = traversers;
         }
+
+        public override Bytecode Bytecode => throw new NotSupportedException("Remote traversals do not have Bytecode");
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/IRemoteConnection.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/IRemoteConnection.cs
index 5393bcb..29bbe29 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/IRemoteConnection.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/IRemoteConnection.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Threading.Tasks;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
index d361ac4..e5efa31 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Remote/RemoteStrategy.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Threading.Tasks;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Barrier.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Barrier.cs
index c65994b..0aa6e14 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Barrier.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Barrier.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,7 +37,7 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Barrier NormSack => new Barrier("normSack");
+        public static Barrier NormSack => new("normSack");
 
         private static readonly IDictionary<string, Barrier> Properties = new Dictionary<string, Barrier>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bindings.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bindings.cs
index a6e13b9..b25a7fc 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bindings.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bindings.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Threading;
 
@@ -34,10 +36,9 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Gets an instance of the <see cref="Bindings" /> class.
         /// </summary>
-        public static Bindings Instance { get; } = new Bindings();
+        public static Bindings Instance { get; } = new();
 
-        private static readonly ThreadLocal<Dictionary<object, string>> BoundVariableByValue =
-            new ThreadLocal<Dictionary<object, string>>();
+        private static readonly ThreadLocal<Dictionary<object, string>> BoundVariableByValue = new();
 
         /// <summary>
         ///     Binds the variable to the specified value.
@@ -46,6 +47,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <param name="value">The value to which the variable should be bound.</param>
         /// <returns>The bound value.</returns>
         public TV Of<TV>(string variable, TV value)
+            where TV : notnull
         {
             var dict = BoundVariableByValue.Value;
             if (dict == null)
@@ -57,7 +59,8 @@ namespace Gremlin.Net.Process.Traversal
             return value;
         }
 
-        internal static string GetBoundVariable<TV>(TV value)
+        internal static string? GetBoundVariable<TV>(TV value)
+            where TV : notnull
         {
             var dict = BoundVariableByValue.Value;
             if (dict == null)
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bytecode.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bytecode.cs
index f4e44f4..f0035fd 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bytecode.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Bytecode.cs
@@ -21,9 +21,12 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 
 namespace Gremlin.Net.Process.Traversal
@@ -89,14 +92,14 @@ namespace Gremlin.Net.Process.Traversal
             Bindings.Clear();
         }
 
-        private object[] FlattenArguments(object[] arguments)
+        private object?[] FlattenArguments(object?[] arguments)
         {
             if (arguments.Length == 0)
                 return EmptyArray;
-            var flatArguments = new List<object>();
+            var flatArguments = new List<object?>();
             foreach (var arg in arguments)
             {
-                if (arg is object[] objects)
+                if (arg is object?[] objects)
                 {
                     flatArguments.AddRange(objects.Select(nestObject => ConvertArgument(nestObject, true)));
                 }
@@ -108,6 +111,7 @@ namespace Gremlin.Net.Process.Traversal
             return flatArguments.ToArray();
         }
 
+        [return: NotNullIfNotNull("argument")]
         private object? ConvertArgument(object? argument, bool searchBindings)
         {
             if (null == argument)
@@ -122,29 +126,30 @@ namespace Gremlin.Net.Process.Traversal
                     return new Binding(variable, ConvertArgument(argument, false));
             }
 
-            if (argument is ITraversal traversal && !traversal.IsAnonymous)
+            if (argument is ITraversal {IsAnonymous: false} traversal)
                 throw new ArgumentException(
                     $"The child traversal of {traversal.Bytecode} was not spawned anonymously - use the __ class rather than a TraversalSource to construct the child traversal");
 
             
             if (IsDictionaryType(argument.GetType()))
             {
-                var dict = new Dictionary<object, object>();
+                var dict = new Dictionary<object, object?>();
                 foreach (DictionaryEntry item in (IDictionary)argument)
                 {
-                    dict[ConvertArgument(item.Key, true)] = ConvertArgument(item.Value, true);
+                    var key = ConvertArgument(item.Key, true);
+                    dict[key] = ConvertArgument(item.Value, true);
                 }
                 return dict;
             }
             if (IsListType(argument.GetType()))
             {
-                var list = new List<object>(((IList) argument).Count);
+                var list = new List<object?>(((IList) argument).Count);
                 list.AddRange(from object item in (IList) argument select ConvertArgument(item, true));
                 return list;
             }
             if (IsHashSetType(argument.GetType()))
             {
-                var set = new HashSet<object>();
+                var set = new HashSet<object?>();
                 foreach (var item in (IEnumerable)argument)
                 {
                     set.Add(ConvertArgument(item, true));
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
index 65663d6..a7eda50 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Cardinality.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,11 +37,11 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Cardinality List => new Cardinality("list");
+        public static Cardinality List => new("list");
 
-        public static Cardinality Set => new Cardinality("set");
+        public static Cardinality Set => new("set");
 
-        public static Cardinality Single => new Cardinality("single");
+        public static Cardinality Single => new("single");
 
         private static readonly IDictionary<string, Cardinality> Properties = new Dictionary<string, Cardinality>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
index 66a6edd..cfe42df 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Column.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,9 +37,9 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Column Keys => new Column("keys");
+        public static Column Keys => new("keys");
 
-        public static Column Values => new Column("values");
+        public static Column Values => new("values");
 
         private static readonly IDictionary<string, Column> Properties = new Dictionary<string, Column>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ConnectedComponent.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ConnectedComponent.cs
index 860e87a..c8d010f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ConnectedComponent.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ConnectedComponent.cs
@@ -21,11 +21,7 @@
 
 #endregion
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
+#nullable enable warnings
 
 namespace Gremlin.Net.Process.Traversal
 {
@@ -34,11 +30,11 @@ namespace Gremlin.Net.Process.Traversal
     public class ConnectedComponent
     {
         
-            public const String component = "gremlin.connectedComponentVertexProgram.component";
+            public const string component = "gremlin.connectedComponentVertexProgram.component";
         
-            public const String edges = "~tinkerpop.connectedComponent.edges";
+            public const string edges = "~tinkerpop.connectedComponent.edges";
         
-            public const String propertyName = "~tinkerpop.connectedComponent.propertyName";
+            public const string propertyName = "~tinkerpop.connectedComponent.propertyName";
         
     }
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
index 38e031c..8348035 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
@@ -21,9 +21,12 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using System.Reflection;
 using System.Threading.Tasks;
 
@@ -34,12 +37,12 @@ namespace Gremlin.Net.Process.Traversal
     /// </summary>
     public abstract class DefaultTraversal<S, E> : ITraversal<S, E>
     {
-        private IEnumerator<Traverser> _traverserEnumerator;
+        private IEnumerator<Traverser>? _traverserEnumerator;
 
         /// <summary>
         ///     Gets the <see cref="Traversal.Bytecode" /> representation of this traversal.
         /// </summary>
-        public Bytecode Bytecode { get; protected set; }
+        public virtual Bytecode Bytecode { get; protected set; } = null!;
         
         /// <summary>
         ///     Determines if this traversal was spawned anonymously or not.
@@ -49,7 +52,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Gets or sets the <see cref="Traverser" />'s of this traversal that hold the results of the traversal.
         /// </summary>
-        public IEnumerable<Traverser> Traversers { get; set; }
+        public IEnumerable<Traverser>? Traversers { get; set; }
 
         ITraversal ITraversal.Iterate()
         {
@@ -61,8 +64,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         protected ICollection<ITraversalStrategy> TraversalStrategies { get; set; } = new List<ITraversalStrategy>();
 
-        private IEnumerator<Traverser> TraverserEnumerator
-            => _traverserEnumerator ?? (_traverserEnumerator = GetTraverserEnumerator());
+        private IEnumerator<Traverser> TraverserEnumerator => _traverserEnumerator ??= GetTraverserEnumerator();
 
         private bool _nextAvailable;
         private bool _fetchedNext;
@@ -108,23 +110,23 @@ namespace Gremlin.Net.Process.Traversal
         }
 
         /// <inheritdoc />
-        public E Current => GetCurrent<E>();
+        public E? Current => GetCurrent<E>();
 
-        object IEnumerator.Current => GetCurrent();
+        object? IEnumerator.Current => GetCurrent();
 
-        private TReturn GetCurrent<TReturn>()
+        private TReturn? GetCurrent<TReturn>()
         {
             var value = GetCurrent();
             var returnType = typeof(TReturn);
             if (value == null || value.GetType() == returnType)
             {
                 // Avoid evaluating type comparisons
-                return (TReturn) value;
+                return (TReturn?) value;
             }
-            return (TReturn) GetValue(returnType, value);
+            return (TReturn?) GetValue(returnType, value);
         }
 
-        private object GetCurrent()
+        private object? GetCurrent()
         {
             // Use dynamic to object to prevent runtime dynamic conversion evaluation
             return TraverserEnumerator.Current?.Object;
@@ -133,7 +135,8 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         /// Gets the value, converting to the expected type when necessary and supported. 
         /// </summary>
-        private static object GetValue(Type type, object value)
+        [return: NotNullIfNotNull("value")]
+        private static object? GetValue(Type type, object? value)
         {
             var genericType = type.GetTypeInfo().IsGenericType
                 ? type.GetTypeInfo().GetGenericTypeDefinition()
@@ -143,7 +146,11 @@ namespace Gremlin.Net.Process.Traversal
                 var keyType = type.GenericTypeArguments[0];
                 var valueType = type.GenericTypeArguments[1];
                 var mapType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType);
-                var result = (IDictionary) Activator.CreateInstance(mapType);
+                var result = (IDictionary?) Activator.CreateInstance(mapType);
+                if (result == null)
+                {
+                    throw new InvalidOperationException($"Cannot convert value {value} to a Dictionary.");
+                }
                 foreach (DictionaryEntry kv in dictValue)
                 {
                     result.Add(GetValue(keyType, kv.Key), GetValue(valueType, kv.Value));
@@ -154,7 +161,11 @@ namespace Gremlin.Net.Process.Traversal
             {
                 var childType = type.GenericTypeArguments[0];
                 var listType = typeof(List<>).MakeGenericType(childType);
-                var result = (IList) Activator.CreateInstance(listType);
+                var result = (IList?) Activator.CreateInstance(listType);
+                if (result == null)
+                {
+                    throw new InvalidOperationException($"Cannot convert value {value} to a list.");
+                }
                 foreach (var itemValue in enumerableValue)
                 {
                     result.Add(itemValue);
@@ -168,6 +179,11 @@ namespace Gremlin.Net.Process.Traversal
         {
             if (Traversers == null)
                 ApplyStrategies();
+            if (Traversers == null)
+            {
+                throw new InvalidOperationException(
+                    $"Cannot enumerate the traversal as there are no {nameof(Traversers)}. Maybe a strategy needs to be added.");
+            }
             return Traversers.GetEnumerator();
         }
 
@@ -195,7 +211,7 @@ namespace Gremlin.Net.Process.Traversal
         ///     Gets the next result from the traversal.
         /// </summary>
         /// <returns>The result.</returns>
-        public E Next()
+        public E? Next()
         {
             MoveNext();
             return Current;
@@ -206,7 +222,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         /// <param name="amount">The number of results to get.</param>
         /// <returns>The n-results.</returns>
-        public IEnumerable<E> Next(int amount)
+        public IEnumerable<E?> Next(int amount)
         {
             for (var i = 0; i < amount; i++)
                 yield return Next();
@@ -239,9 +255,9 @@ namespace Gremlin.Net.Process.Traversal
         ///     Puts all the results into a <see cref="List{T}" />.
         /// </summary>
         /// <returns>The results in a list.</returns>
-        public IList<E> ToList()
+        public IList<E?> ToList()
         {
-            var objs = new List<E>();
+            var objs = new List<E?>();
             while (MoveNext())
                 objs.Add(Current);
             return objs;
@@ -251,9 +267,9 @@ namespace Gremlin.Net.Process.Traversal
         ///     Puts all the results into a <see cref="HashSet{T}" />.
         /// </summary>
         /// <returns>The results in a set.</returns>
-        public ISet<E> ToSet()
+        public ISet<E?> ToSet()
         {
-            var objs = new HashSet<E>();
+            var objs = new HashSet<E?>();
             while (MoveNext())
                 objs.Add(Current);
             return objs;
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
index 8c3ed4a..10cbb20 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Direction.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,11 +37,11 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Direction Both => new Direction("BOTH");
+        public static Direction Both => new("BOTH");
 
-        public static Direction In => new Direction("IN");
+        public static Direction In => new("IN");
 
-        public static Direction Out => new Direction("OUT");
+        public static Direction Out => new("OUT");
 
         private static readonly IDictionary<string, Direction> Properties = new Dictionary<string, Direction>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/EnumWrapper.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/EnumWrapper.cs
index 20a0348..e783e7e 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/EnumWrapper.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/EnumWrapper.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 
 namespace Gremlin.Net.Process.Traversal
@@ -52,7 +54,7 @@ namespace Gremlin.Net.Process.Traversal
         }
 
         /// <inheritdoc />
-        public bool Equals(EnumWrapper other)
+        public bool Equals(EnumWrapper? other)
         {
             if (ReferenceEquals(null, other)) return false;
             if (ReferenceEquals(this, other)) return true;
@@ -60,7 +62,7 @@ namespace Gremlin.Net.Process.Traversal
         }
 
         /// <inheritdoc />
-        public override bool Equals(object obj)
+        public override bool Equals(object? obj)
         {
             if (ReferenceEquals(null, obj)) return false;
             if (ReferenceEquals(this, obj)) return true;
@@ -73,8 +75,7 @@ namespace Gremlin.Net.Process.Traversal
         {
             unchecked
             {
-                return ((EnumName != null ? EnumName.GetHashCode() : 0) * 397) ^
-                       (EnumValue != null ? EnumValue.GetHashCode() : 0);
+                return (EnumName.GetHashCode() * 397) ^ EnumValue.GetHashCode();
             }
         }
     }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
index e79c86e..1563a34 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphSONVersion.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,11 +37,11 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static GraphSONVersion V1_0 => new GraphSONVersion("V1_0");
+        public static GraphSONVersion V1_0 => new("V1_0");
 
-        public static GraphSONVersion V2_0 => new GraphSONVersion("V2_0");
+        public static GraphSONVersion V2_0 => new("V2_0");
 
-        public static GraphSONVersion V3_0 => new GraphSONVersion("V3_0");
+        public static GraphSONVersion V3_0 => new("V3_0");
 
         private static readonly IDictionary<string, GraphSONVersion> Properties = new Dictionary<string, GraphSONVersion>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GryoVersion.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GryoVersion.cs
index e34c7b3..c1405c7 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GryoVersion.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GryoVersion.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,9 +37,9 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static GryoVersion V1_0 => new GryoVersion("V1_0");
+        public static GryoVersion V1_0 => new("V1_0");
 
-        public static GryoVersion V3_0 => new GryoVersion("V3_0");
+        public static GryoVersion V3_0 => new("V3_0");
 
         private static readonly IDictionary<string, GryoVersion> Properties = new Dictionary<string, GryoVersion>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBiFunction.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBiFunction.cs
index 15c9f91..babb85e 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBiFunction.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBiFunction.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBinaryOperator.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBinaryOperator.cs
index dcd7aed..92c2b97 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBinaryOperator.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IBinaryOperator.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IComparator.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IComparator.cs
index b7a48e0..65e8d90 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IComparator.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IComparator.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IConsumer.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IConsumer.cs
index 7eed5e2..4eb40c8 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IConsumer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IConsumer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IFunction.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IFunction.cs
index 075154a..9e38377 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IFunction.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IFunction.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IO.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IO.cs
index b9e0fdd..0fe1f2c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IO.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IO.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -34,17 +36,17 @@ namespace Gremlin.Net.Process.Traversal
     public class IO
     {
         
-            public const String graphml = "graphml";
+            public const string graphml = "graphml";
         
-            public const String graphson = "graphson";
+            public const string graphson = "graphson";
         
-            public const String gryo = "gryo";
+            public const string gryo = "gryo";
         
-            public const String reader = "~tinkerpop.io.reader";
+            public const string reader = "~tinkerpop.io.reader";
         
-            public const String registry = "~tinkerpop.io.registry";
+            public const string registry = "~tinkerpop.io.registry";
         
-            public const String writer = "~tinkerpop.io.writer";
+            public const string writer = "~tinkerpop.io.writer";
         
     }
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IPredicate.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IPredicate.cs
index a7e5e3d..1d5932c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IPredicate.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IPredicate.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ISupplier.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ISupplier.cs
index b1dda13..61b4b7e 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ISupplier.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ISupplier.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversal.cs
index 95cbb74..e2b2884 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversal.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversal.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -47,7 +49,7 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Gets or sets the <see cref="Traverser" />'s of this traversal that hold the results of the traversal.
         /// </summary>
-        IEnumerable<Traverser> Traversers { get; set; }
+        IEnumerable<Traverser>? Traversers { get; set; }
 
         /// <summary>
         ///     Iterates all <see cref="Traverser" /> instances in the traversal.
@@ -59,13 +61,13 @@ namespace Gremlin.Net.Process.Traversal
     /// <summary>
     ///     A traversal represents a directed walk over a graph.
     /// </summary>
-    public interface ITraversal<S, E> : ITraversal, IEnumerator<E>
+    public interface ITraversal<S, E> : ITraversal, IEnumerator<E?>
     {
         /// <summary>
         ///     Gets the next result from the traversal.
         /// </summary>
         /// <returns>The result.</returns>
-        E Next();
+        E? Next();
 
         /// <summary>
         ///     Determines if the traversal contains any additional results for iteration.
@@ -78,7 +80,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         /// <param name="amount">The number of results to get.</param>
         /// <returns>The n-results.</returns>
-        IEnumerable<E> Next(int amount);
+        IEnumerable<E?> Next(int amount);
 
         /// <summary>
         ///     Iterates all <see cref="Traverser" /> instances in the traversal.
@@ -96,13 +98,13 @@ namespace Gremlin.Net.Process.Traversal
         ///     Puts all the results into a <see cref="IList{T}" />.
         /// </summary>
         /// <returns>The results in a list.</returns>
-        IList<E> ToList();
+        IList<E?> ToList();
 
         /// <summary>
         ///     Puts all the results into a <see cref="ISet{T}" />.
         /// </summary>
         /// <returns>The results in a set.</returns>
-        ISet<E> ToSet();
+        ISet<E?> ToSet();
 
         /// <summary>
         ///     Starts a promise to execute a function on the current traversal that will be completed in the future.
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversalStrategy.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversalStrategy.cs
index 013d62a..d246287 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversalStrategy.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ITraversalStrategy.cs
@@ -23,6 +23,8 @@
 
 using System.Threading.Tasks;
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IUnaryOperator.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IUnaryOperator.cs
index b57be02..eaee14f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IUnaryOperator.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/IUnaryOperator.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Instruction.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Instruction.cs
index 1063b33..0b44a12 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Instruction.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Instruction.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Linq;
 
@@ -36,7 +38,7 @@ namespace Gremlin.Net.Process.Traversal
         /// </summary>
         /// <param name="operatorName">The name of the operator.</param>
         /// <param name="arguments">The arguments.</param>
-        public Instruction(string operatorName, params dynamic[] arguments)
+        public Instruction(string operatorName, params dynamic?[] arguments)
         {
             OperatorName = operatorName;
             Arguments = arguments;
@@ -50,18 +52,18 @@ namespace Gremlin.Net.Process.Traversal
         /// <summary>
         ///     Gets the arguments.
         /// </summary>
-        public dynamic[] Arguments { get; }
+        public dynamic?[] Arguments { get; }
 
         /// <summary>
         ///     String representation of the <see cref="Instruction"/>.
         /// </summary>
         public override string ToString()
         {
-            return OperatorName + " [" + String.Join(",", Arguments) + "]";
+            return OperatorName + " [" + string.Join(",", Arguments) + "]";
         }
 
         /// <inheritdoc />
-        public bool Equals(Instruction other)
+        public bool Equals(Instruction? other)
         {
             if (ReferenceEquals(null, other)) return false;
             if (ReferenceEquals(this, other)) return true;
@@ -69,7 +71,7 @@ namespace Gremlin.Net.Process.Traversal
         }
 
         /// <inheritdoc />
-        public override bool Equals(object obj)
+        public override bool Equals(object? obj)
         {
             if (ReferenceEquals(null, obj)) return false;
             if (ReferenceEquals(this, obj)) return true;
@@ -83,15 +85,10 @@ namespace Gremlin.Net.Process.Traversal
             unchecked
             {
                 var hash = 19;
-                if (OperatorName != null)
-                {
-                    hash = hash * 397 + OperatorName.GetHashCode();
-                }
+                hash = hash * 397 + OperatorName.GetHashCode();
 
-                if (Arguments != null)
-                {
-                    hash = Arguments.Aggregate(hash, (current, value) => current * 31 + value.GetHashCode());
-                }
+                hash = Arguments.Aggregate(hash,
+                    (current, value) => current * 31 + (value == null ? 0 : value.GetHashCode()));
 
                 return hash;
             }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Lambda.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Lambda.cs
index 01bdbc6..99a4248 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Lambda.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Lambda.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Process.Traversal
 {
     /// <summary>
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/NamingConversions.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/NamingConversions.cs
deleted file mode 100644
index a650dc5..0000000
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/NamingConversions.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-#region License
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#endregion
-
-using System.Collections.Generic;
-
-namespace Gremlin.Net.Process.Traversal
-{
-    internal static class NamingConversions
-    {
-        /// <summary>
-        ///     Gets the Java name equivalent for a given enum value
-        /// </summary>
-        internal static string GetEnumJavaName(string typeName, string value)
-        {
-            var key = $"{typeName}.{value}";
-            string javaName;
-            if (!CSharpToJavaEnums.TryGetValue(key, out javaName))
-            {
-                throw new KeyNotFoundException($"Java name for {key} not found");
-            }
-            return javaName;
-        }
-
-        internal static readonly IDictionary<string, string> CSharpToJavaEnums = new Dictionary<string, string>
-        {
-            {"Barrier.NormSack", "normSack"},
-            {"Cardinality.List", "list"},
-            {"Cardinality.Set", "set"},
-            {"Cardinality.Single", "single"},
-            {"Column.Keys", "keys"},
-            {"Column.Values", "values"},
-            {"Direction.Both", "BOTH"},
-            {"Direction.In", "IN"},
-            {"Direction.Out", "OUT"},
-            {"GraphSONVersion.V1_0", "V1_0"},
-            {"GraphSONVersion.V2_0", "V2_0"},
-            {"GraphSONVersion.V3_0", "V3_0"},
-            {"GryoVersion.V1_0", "V1_0"},
-            {"GryoVersion.V3_0", "V3_0"},
-            {"Operator.AddAll", "addAll"},
-            {"Operator.And", "and"},
-            {"Operator.Assign", "assign"},
-            {"Operator.Div", "div"},
-            {"Operator.Max", "max"},
-            {"Operator.Min", "min"},
-            {"Operator.Minus", "minus"},
-            {"Operator.Mult", "mult"},
-            {"Operator.Or", "or"},
-            {"Operator.Sum", "sum"},
-            {"Operator.SumLong", "sumLong"},
-            {"Order.Decr", "decr"},
-            {"Order.Incr", "incr"},
-            {"Order.Shuffle", "shuffle"},
-            {"Order.Asc", "asc"},
-            {"Order.Desc", "desc"},
-            {"Pick.Any", "any"},
-            {"Pick.None", "none"},
-            {"Pop.All", "all"},
-            {"Pop.First", "first"},
-            {"Pop.Last", "last"},
-            {"Pop.Mixed", "mixed"},
-            {"Scope.Global", "global"},
-            {"Scope.Local", "local"},
-            {"T.Id", "id"},
-            {"T.Key", "key"},
-            {"T.Label", "label"},
-            {"T.Value", "value"}
-
-        };
-    }
-}
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
index ce33569..38703df 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Operator.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,27 +37,27 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Operator AddAll => new Operator("addAll");
+        public static Operator AddAll => new("addAll");
 
-        public static Operator And => new Operator("and");
+        public static Operator And => new("and");
 
-        public static Operator Assign => new Operator("assign");
+        public static Operator Assign => new("assign");
 
-        public static Operator Div => new Operator("div");
+        public static Operator Div => new("div");
 
-        public static Operator Max => new Operator("max");
+        public static Operator Max => new("max");
 
-        public static Operator Min => new Operator("min");
+        public static Operator Min => new("min");
 
-        public static Operator Minus => new Operator("minus");
+        public static Operator Minus => new("minus");
 
-        public static Operator Mult => new Operator("mult");
+        public static Operator Mult => new("mult");
 
-        public static Operator Or => new Operator("or");
+        public static Operator Or => new("or");
 
-        public static Operator Sum => new Operator("sum");
+        public static Operator Sum => new("sum");
 
-        public static Operator SumLong => new Operator("sumLong");
+        public static Operator SumLong => new("sumLong");
 
         private static readonly IDictionary<string, Operator> Properties = new Dictionary<string, Operator>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
index fca67ab..eb65b43 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Order.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,11 +37,11 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Order Asc => new Order("asc");
+        public static Order Asc => new("asc");
 
-        public static Order Desc => new Order("desc");
+        public static Order Desc => new("desc");
 
-        public static Order Shuffle => new Order("shuffle");
+        public static Order Shuffle => new("shuffle");
 
         private static readonly IDictionary<string, Order> Properties = new Dictionary<string, Order>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PageRank.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PageRank.cs
index 5c2ade9..c674149 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PageRank.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PageRank.cs
@@ -21,11 +21,7 @@
 
 #endregion
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
+#nullable enable warnings
 
 namespace Gremlin.Net.Process.Traversal
 {
@@ -34,11 +30,11 @@ namespace Gremlin.Net.Process.Traversal
     public class PageRank
     {
         
-            public const String edges = "~tinkerpop.pageRank.edges";
+            public const string edges = "~tinkerpop.pageRank.edges";
         
-            public const String propertyName = "~tinkerpop.pageRank.propertyName";
+            public const string propertyName = "~tinkerpop.pageRank.propertyName";
         
-            public const String times = "~tinkerpop.pageRank.times";
+            public const string times = "~tinkerpop.pageRank.times";
         
     }
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PeerPressure.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PeerPressure.cs
index fde3b41..4e02427 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PeerPressure.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/PeerPressure.cs
@@ -21,11 +21,7 @@
 
 #endregion
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
+#nullable enable warnings
 
 namespace Gremlin.Net.Process.Traversal
 {
@@ -34,11 +30,11 @@ namespace Gremlin.Net.Process.Traversal
     public class PeerPressure
     {
         
-            public const String edges = "~tinkerpop.peerPressure.edges";
+            public const string edges = "~tinkerpop.peerPressure.edges";
         
-            public const String propertyName = "~tinkerpop.peerPressure.propertyName";
+            public const string propertyName = "~tinkerpop.peerPressure.propertyName";
         
-            public const String times = "~tinkerpop.peerPressure.times";
+            public const string times = "~tinkerpop.peerPressure.times";
         
     }
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
index f0312a3..6cc4a17 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pick.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,9 +37,9 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Pick Any => new Pick("any");
+        public static Pick Any => new("any");
 
-        public static Pick None => new Pick("none");
+        public static Pick None => new("none");
 
         private static readonly IDictionary<string, Pick> Properties = new Dictionary<string, Pick>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
index 196ce01..1ff98d0 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Pop.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,13 +37,13 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Pop All => new Pop("all");
+        public static Pop All => new("all");
 
-        public static Pop First => new Pop("first");
+        public static Pop First => new("first");
 
-        public static Pop Last => new Pop("last");
+        public static Pop Last => new("last");
 
-        public static Pop Mixed => new Pop("mixed");
+        public static Pop Mixed => new("mixed");
 
         private static readonly IDictionary<string, Pop> Properties = new Dictionary<string, Pop>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
index ff70069..43a3f5c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/Scope.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,9 +37,9 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static Scope Global => new Scope("global");
+        public static Scope Global => new("global");
 
-        public static Scope Local => new Scope("local");
+        public static Scope Local => new("local");
 
         private static readonly IDictionary<string, Scope> Properties = new Dictionary<string, Scope>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ShortestPath.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ShortestPath.cs
index 238a5e7..bd26a84 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ShortestPath.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/ShortestPath.cs
@@ -21,11 +21,7 @@
 
 #endregion
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
+#nullable enable warnings
 
 namespace Gremlin.Net.Process.Traversal
 {
@@ -34,15 +30,15 @@ namespace Gremlin.Net.Process.Traversal
     public class ShortestPath
     {
         
-            public const String distance = "~tinkerpop.shortestPath.distance";
+            public const string distance = "~tinkerpop.shortestPath.distance";
         
-            public const String edges = "~tinkerpop.shortestPath.edges";
+            public const string edges = "~tinkerpop.shortestPath.edges";
         
-            public const String includeEdges = "~tinkerpop.shortestPath.includeEdges";
+            public const string includeEdges = "~tinkerpop.shortestPath.includeEdges";
         
-            public const String maxDistance = "~tinkerpop.shortestPath.maxDistance";
+            public const string maxDistance = "~tinkerpop.shortestPath.maxDistance";
         
-            public const String target = "~tinkerpop.shortestPath.target";
+            public const string target = "~tinkerpop.shortestPath.target";
         
     }
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/StringBasedLambda.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/StringBasedLambda.cs
index 69f8030..1299df5 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/StringBasedLambda.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/StringBasedLambda.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 
 namespace Gremlin.Net.Process.Traversal
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
index e688e8d..1411983 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/T.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
@@ -35,13 +37,13 @@ namespace Gremlin.Net.Process.Traversal
         {
         }
 
-        public static T Id => new T("id");
+        public static T Id => new("id");
 
-        public static T Key => new T("key");
+        public static T Key => new("key");
 
-        public static T Label => new T("label");
+        public static T Label => new("label");
 
-        public static T Value => new T("value");
+        public static T Value => new("value");
 
         private static readonly IDictionary<string, T> Properties = new Dictionary<string, T>
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/WithOptions.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/WithOptions.cs
index 0229d4c..1d0d132 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/WithOptions.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/WithOptions.cs
@@ -21,11 +21,7 @@
 
 #endregion
 
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
+#nullable enable warnings
 
 namespace Gremlin.Net.Process.Traversal.Step.Util
 {
@@ -36,8 +32,6 @@ namespace Gremlin.Net.Process.Traversal.Step.Util
     /// </summary>
     public class WithOptions
     {
-
-
         public static readonly string Tokens = "~tinkerpop.valueMap.tokens";
 
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs
index 27d5de1..78e741e 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Utils.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Runtime.ExceptionServices;
 using System.Threading.Tasks;
@@ -44,7 +46,7 @@ namespace Gremlin.Net.Process
             }
             catch (AggregateException ex)
             {
-                if (ex.InnerExceptions.Count == 1)
+                if (ex.InnerException != null)
                 {
                     ExceptionDispatchInfo.Capture(ex.InnerException).Throw();   
                 }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/GraphTraversalTests.cs
similarity index 73%
copy from gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs
copy to gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/GraphTraversalTests.cs
index ea375bd..52df33c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteTraversal.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/GraphTraversalTests.cs
@@ -21,16 +21,20 @@
 
 #endregion
 
-using System.Collections.Generic;
+using System;
 using Gremlin.Net.Process.Traversal;
+using Xunit;
 
-namespace Gremlin.Net.Driver.Remote
+namespace Gremlin.Net.UnitTest.Process.Traversal
 {
-    internal class DriverRemoteTraversal<S, E> : DefaultTraversal<S, E>
+    public class GraphTraversalTests
     {
-        public DriverRemoteTraversal(IEnumerable<Traverser> traversers)
+        [Fact]
+        public void ShouldThrowOnIterationIfNoStrategiesConfigured()
         {
-            Traversers = traversers;
+            var g = AnonymousTraversalSource.Traversal();
+
+            Assert.Throws<InvalidOperationException>(() => g.V().Next());
         }
     }
 }
\ No newline at end of file

[tinkerpop] 01/03: Enable nullable warnings for GraphSON

Posted by fl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

florianhockmann pushed a commit to branch TINKERPOP-2348
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 97f5b7e95d0378b2e2dcdd6ea8191d20cc03a935
Author: Florian Hockmann <fh...@florian-hockmann.de>
AuthorDate: Wed Apr 28 14:06:56 2021 +0200

    Enable nullable warnings for GraphSON
---
 .../IO/GraphBinary/Types/PathSerializer.cs         |  2 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs          |  4 ++++
 .../Structure/IO/GraphSON/BigIntegerSerializer.cs  |  2 ++
 .../Structure/IO/GraphSON/BindingSerializer.cs     |  4 +++-
 .../Structure/IO/GraphSON/BulkSetSerializer.cs     |  4 +++-
 .../IO/GraphSON/ByteBufferDeserializer.cs          |  4 +++-
 .../Structure/IO/GraphSON/ByteBufferSerializer.cs  |  2 ++
 .../Structure/IO/GraphSON/ByteConverter.cs         |  2 ++
 .../Structure/IO/GraphSON/BytecodeSerializer.cs    |  2 ++
 .../Structure/IO/GraphSON/CharConverter.cs         |  5 ++++-
 .../Structure/IO/GraphSON/ClassSerializer.cs       | 12 +++++++++--
 .../Structure/IO/GraphSON/DateDeserializer.cs      |  4 +++-
 .../Structure/IO/GraphSON/DateSerializer.cs        |  2 ++
 .../Structure/IO/GraphSON/DecimalConverter.cs      |  8 +++++++-
 .../Structure/IO/GraphSON/DirectionDeserializer.cs |  7 ++++++-
 .../Structure/IO/GraphSON/DurationDeserializer.cs  |  6 +++++-
 .../Structure/IO/GraphSON/DurationSerializer.cs    |  2 ++
 .../Structure/IO/GraphSON/EdgeDeserializer.cs      |  2 ++
 .../Structure/IO/GraphSON/EdgeSerializer.cs        |  2 ++
 .../Structure/IO/GraphSON/EnumSerializer.cs        |  2 ++
 .../Structure/IO/GraphSON/FloatConverter.cs        |  2 ++
 .../IO/GraphSON/GraphSON2MessageSerializer.cs      |  4 +++-
 .../Structure/IO/GraphSON/GraphSON2Reader.cs       |  2 ++
 .../Structure/IO/GraphSON/GraphSON2Writer.cs       |  2 ++
 .../Structure/IO/GraphSON/GraphSON3Reader.cs       |  2 ++
 .../Structure/IO/GraphSON/GraphSON3Writer.cs       |  2 ++
 .../IO/GraphSON/GraphSONMessageSerializer.cs       |  7 +++++--
 .../Structure/IO/GraphSON/GraphSONReader.cs        | 16 +++++++++------
 .../Structure/IO/GraphSON/GraphSONTokens.cs        |  8 +++++---
 .../Structure/IO/GraphSON/GraphSONUtil.cs          |  9 ++++++---
 .../Structure/IO/GraphSON/GraphSONWriter.cs        | 15 +++++++-------
 .../Structure/IO/GraphSON/IGraphSONDeserializer.cs |  4 +++-
 .../Structure/IO/GraphSON/IGraphSONSerializer.cs   |  2 ++
 .../Structure/IO/GraphSON/Int16Converter.cs        |  2 ++
 .../Structure/IO/GraphSON/Int32Converter.cs        |  2 ++
 .../Structure/IO/GraphSON/Int64Converter.cs        |  2 ++
 .../Structure/IO/GraphSON/LambdaSerializer.cs      |  2 ++
 .../Structure/IO/GraphSON/ListSerializer.cs        |  4 +++-
 .../Structure/IO/GraphSON/MapSerializer.cs         |  8 +++++---
 .../Structure/IO/GraphSON/NumberConverter.cs       |  3 +++
 .../Structure/IO/GraphSON/PSerializer.cs           |  2 ++
 .../Structure/IO/GraphSON/Path3Deserializer.cs     | 11 ++++++++---
 .../Structure/IO/GraphSON/PathDeserializer.cs      |  6 +++++-
 .../Structure/IO/GraphSON/PropertyDeserializer.cs  |  2 ++
 .../Structure/IO/GraphSON/PropertySerializer.cs    | 10 +++++++++-
 .../IO/GraphSON/RequestMessageSerializer.cs        |  2 ++
 .../Structure/IO/GraphSON/SetSerializer.cs         |  4 +++-
 .../Structure/IO/GraphSON/TDeserializer.cs         |  6 +++++-
 .../Structure/IO/GraphSON/TextPSerializer.cs       |  2 ++
 .../Structure/IO/GraphSON/TraversalSerializer.cs   | 11 ++++++++++-
 .../IO/GraphSON/TraversalStrategySerializer.cs     |  2 ++
 .../Structure/IO/GraphSON/TraverserReader.cs       |  2 ++
 .../Structure/IO/GraphSON/UuidDeserializer.cs      |  6 +++++-
 .../Structure/IO/GraphSON/UuidSerializer.cs        |  2 ++
 .../Structure/IO/GraphSON/VertexDeserializer.cs    |  2 ++
 .../IO/GraphSON/VertexPropertyDeserializer.cs      |  2 ++
 .../IO/GraphSON/VertexPropertySerializer.cs        |  9 +++++++--
 .../Structure/IO/GraphSON/VertexSerializer.cs      |  2 ++
 gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs   | 23 +++++++++++++---------
 .../Gherkin/GherkinTestRunner.cs                   |  2 +-
 .../Driver/GraphSONMessageSerializerTests.cs       | 15 +++++++-------
 .../Structure/IO/GraphSON/GraphSONWriterTests.cs   | 13 ++++++++++++
 62 files changed, 245 insertions(+), 67 deletions(-)

diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphBinary/Types/PathSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphBinary/Types/PathSerializer.cs
index 7b0ba76..5bc3ba8 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphBinary/Types/PathSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphBinary/Types/PathSerializer.cs
@@ -64,7 +64,7 @@ namespace Gremlin.Net.Structure.IO.GraphBinary.Types
                 labels.Add(labelSet);
             }
             
-            var objects = (List<object>?) await reader.ReadAsync(stream).ConfigureAwait(false);
+            var objects = (List<object?>?) await reader.ReadAsync(stream).ConfigureAwait(false);
             if (objects == null) throw new IOException("Read null, but expected a list of objects");
             return new Path(labels, objects);
         }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
index a3f1ff6..0b878b6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
@@ -21,6 +21,9 @@
 
 #endregion
 
+#nullable enable warnings
+
+using System.IO;
 using System.Numerics;
 using System.Text.Json;
 
@@ -31,6 +34,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public dynamic Objectify(JsonElement graphson, GraphSONReader reader)
         {
             var bigInteger = graphson.ValueKind == JsonValueKind.String ? graphson.GetString() : graphson.GetRawText();
+            if (bigInteger == null) throw new IOException("Read null, but expected a BigInteger string representation");
             return BigInteger.Parse(bigInteger);
         }
     }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
index b53f752..8535443 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Numerics;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BindingSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BindingSerializer.cs
index d183447..89a41e6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BindingSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BindingSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal;
 
@@ -30,7 +32,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     {
         public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
         {
-            var binding = (Binding) objectData;
+            Binding binding =  objectData;
             var valueDict = new Dictionary<string, object>
             {
                 {"value", writer.ToDict(binding.Value)},
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BulkSetSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BulkSetSerializer.cs
index 539224a..1a121eb 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BulkSetSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BulkSetSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Linq;
 using System.Text.Json;
@@ -42,7 +44,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             // previous versions.
             return Enumerable.Range(0, graphsonObject.GetArrayLength() / 2).SelectMany<int, object>(i =>
                 Enumerable.Repeat<object>(reader.ToObject(graphsonObject[i * 2]),
-                    (int) reader.ToObject(graphsonObject[i * 2 + 1]))).ToList();
+                    (int) reader.ToObject(graphsonObject[i * 2 + 1])!)).ToList();
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
index 0feb3a2..adb4efa 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
@@ -21,6 +21,7 @@
 #endregion
 
 using System;
+using System.IO;
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -30,7 +31,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
             var base64String = graphsonObject.GetString();
-            return Convert.FromBase64String(base64String);
+            return Convert.FromBase64String(base64String ??
+                                            throw new IOException("Read null but expected a base64 byte string"));
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
index 09d4f27..a9fa2bf 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
@@ -20,6 +20,8 @@
  */
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
index c9fc8a5..41793ad 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
@@ -20,6 +20,8 @@
  */
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BytecodeSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BytecodeSerializer.cs
index 28cfe0a..23e9750 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BytecodeSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BytecodeSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Linq;
 using Gremlin.Net.Process.Traversal;
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
index 0c3e539..3f12daa 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
@@ -20,6 +20,9 @@
  */
 #endregion
 
+#nullable enable warnings
+
+using System.IO;
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -31,7 +34,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         protected override bool StringifyValue => true;
         protected override dynamic FromJsonElement(JsonElement graphson)
         {
-            var deserializedByte = graphson.GetString();
+            var deserializedByte = graphson.GetString() ?? throw new IOException("Read null but expected a string");
             return deserializedByte[0];
         }
     }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ClassSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ClassSerializer.cs
index 39d1abe..0687ece 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ClassSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ClassSerializer.cs
@@ -21,8 +21,11 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
+using System.IO;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
@@ -30,8 +33,13 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     {
         public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
         {
-            var type = (Type) objectData;
-            return writer.ToDict(Activator.CreateInstance(type));
+            Type type = objectData;
+            var dictifiedObject = writer.ToDict(Activator.CreateInstance(type));
+            if (dictifiedObject == null)
+            {
+                throw new IOException($"Could not write type {objectData}, maybe it is not a supported type");
+            }
+            return dictifiedObject;
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
index bc5bf61..7aa0cd1 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
@@ -20,6 +20,8 @@
  */
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Text.Json;
 
@@ -27,7 +29,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
 {
     internal class DateDeserializer : IGraphSONDeserializer
     {
-        private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
+        private static readonly DateTimeOffset UnixStart = new(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
 
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
index a3c7263..ed8e44f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
index f195522..5c4a78e 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
@@ -21,7 +21,11 @@
 
 #endregion
 
+#nullable enable warnings
+
+using System;
 using System.Globalization;
+using System.IO;
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -35,7 +39,9 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         {
             if (graphson.ValueKind == JsonValueKind.String)
             {
-                return decimal.Parse(graphson.GetString(), CultureInfo.InvariantCulture);
+                return decimal.Parse(
+                    graphson.GetString() ?? throw new IOException("Read null but expected a decimal string"),
+                    CultureInfo.InvariantCulture);
             }
             return graphson.GetDecimal();
         }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DirectionDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DirectionDeserializer.cs
index 34d4f61..aad9afb 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DirectionDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DirectionDeserializer.cs
@@ -21,6 +21,9 @@
 
 #endregion
 
+#nullable enable warnings
+
+using System.IO;
 using System.Text.Json;
 using Gremlin.Net.Process.Traversal;
 
@@ -30,7 +33,9 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     {
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
-            return Direction.GetByValue(graphsonObject.GetString());
+            return Direction.GetByValue(graphsonObject.GetString() ??
+                                        throw new IOException(
+                                            $"Read null but expected a {nameof(Direction)} string representation"));
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
index 2c1d17f..123bb31 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
@@ -21,6 +21,9 @@
 
 #endregion
 
+#nullable enable warnings
+
+using System.IO;
 using System.Text.Json;
 using System.Xml;
 
@@ -30,7 +33,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     {
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
-            var duration = graphsonObject.GetString();
+            var duration = graphsonObject.GetString() ??
+                           throw new IOException("Read null but expected a Duration string representation");
             return XmlConvert.ToTimeSpan(duration);
         }
     }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
index 9fe5fcd..7c44a53 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 using System.Xml;
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs
index 13f4ce0..f91352a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeDeserializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeSerializer.cs
index fd9f496..1d896b6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EdgeSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EnumSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EnumSerializer.cs
index ccea7cd..aa67862 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EnumSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/EnumSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/FloatConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/FloatConverter.cs
index 5bbd9b2..7db0a20 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/FloatConverter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/FloatConverter.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2MessageSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2MessageSerializer.cs
index c0c36b1..c588ecd 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2MessageSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2MessageSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
     /// <summary>
@@ -35,7 +37,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// </summary>
         /// <param name="graphSONReader">The <see cref="GraphSON2Reader"/> used to deserialize from GraphSON.</param>
         /// <param name="graphSONWriter">The <see cref="GraphSON2Writer"/> used to serialize to GraphSON.</param>
-        public GraphSON2MessageSerializer(GraphSON2Reader graphSONReader = null, GraphSON2Writer graphSONWriter = null)
+        public GraphSON2MessageSerializer(GraphSON2Reader? graphSONReader = null, GraphSON2Writer? graphSONWriter = null)
             : base(MimeType, graphSONReader ?? new GraphSON2Reader(), graphSONWriter ?? new GraphSON2Writer())
         {
         }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Reader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Reader.cs
index 90c9e4d..daa2384 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Reader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Reader.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Writer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Writer.cs
index b1083da..117dbba 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Writer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON2Writer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Reader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Reader.cs
index 7cc17bd..5502584 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Reader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Reader.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Writer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Writer.cs
index 0469bbe..d8c8bfb 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Writer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSON3Writer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONMessageSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONMessageSerializer.cs
index c5dddf8..3bcb7c2 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONMessageSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONMessageSerializer.cs
@@ -21,8 +21,11 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 using System.Text.Json;
 using System.Threading.Tasks;
@@ -72,12 +75,12 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public virtual Task<ResponseMessage<List<object>>> DeserializeMessageAsync(byte[] message)
         {
             if (message == null) throw new ArgumentNullException(nameof(message));
-            if (message.Length == 0) return Task.FromResult<ResponseMessage<List<object>>>(null);
+            if (message.Length == 0) throw new IOException("Cannot deserialize an empty response message");
             
             var reader = new Utf8JsonReader(message);
             var responseMessage =
                 JsonSerializer.Deserialize<ResponseMessage<JsonElement>>(ref reader, JsonDeserializingOptions);
-            if (responseMessage == null) return Task.FromResult<ResponseMessage<List<object>>>(null);;
+            if (responseMessage == null) throw new IOException("Message could not be deserialized / is empty");
             
             var data = _graphSONReader.ToObject(responseMessage.Result.Data);
             return Task.FromResult(CopyMessageWithNewData(responseMessage, data));
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index 16901bd..4e1558f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@ -21,8 +21,11 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text.Json;
 
@@ -36,9 +39,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// <summary>
         /// Contains the <see cref="IGraphSONDeserializer" /> instances by their type identifier. 
         /// </summary>
-        protected readonly Dictionary<string, IGraphSONDeserializer> Deserializers = new Dictionary
-            <string, IGraphSONDeserializer>
-            {
+        protected readonly Dictionary<string, IGraphSONDeserializer> Deserializers = new()
+        {
                 {"g:Traverser", new TraverserReader()},
                 {"g:Int32", new Int32Converter()},
                 {"g:Int64", new Int64Converter()},
@@ -100,7 +102,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// </summary>
         /// <param name="graphSon">The GraphSON to deserialize.</param>
         /// <returns>The deserialized object.</returns>
-        public virtual dynamic ToObject(JsonElement graphSon)
+        public virtual dynamic? ToObject(JsonElement graphSon)
         {
             switch (graphSon.ValueKind)
             {
@@ -123,13 +125,15 @@ namespace Gremlin.Net.Structure.IO.GraphSON
 
             if (graphSon.TryGetProperty(GraphSONTokens.TypeKey, out var graphSonTypeProperty))
             {
-                return ReadValueOfType(graphSon, graphSonTypeProperty.GetString());
+                return ReadValueOfType(graphSon,
+                    graphSonTypeProperty.GetString() ??
+                    throw new IOException("Read GraphSON type key is not a string"));
             }
             return ReadDictionary(graphSon);
             
         }
 
-        private dynamic ReadValueOfType(JsonElement typedValue, string graphSONType)
+        private dynamic? ReadValueOfType(JsonElement typedValue, string graphSONType)
         {
             if (!Deserializers.TryGetValue(graphSONType, out var deserializer))
             {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONTokens.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONTokens.cs
index 8beb850..4faf7f1 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONTokens.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONTokens.cs
@@ -21,12 +21,14 @@
 
 #endregion
 
+#nullable enable warnings
+
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
     internal class GraphSONTokens
     {
-        public static string TypeKey = "@type";
-        public static string ValueKey = "@value";
-        public static string GremlinTypeNamespace = "g";
+        public const string TypeKey = "@type";
+        public const string ValueKey = "@value";
+        public const string GremlinTypeNamespace = "g";
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONUtil.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONUtil.cs
index ccdd47a..62e21cd 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONUtil.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONUtil.cs
@@ -21,9 +21,12 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using Gremlin.Net.Driver;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
@@ -39,7 +42,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// <param name="value">The value to transform.</param>
         /// <param name="prefix">A namespace prefix for the typename.</param>
         /// <returns>The GraphSON representation including type information.</returns>
-        public static Dictionary<string, dynamic> ToTypedValue(string typename, dynamic value, string prefix = "g")
+        public static Dictionary<string, dynamic> ToTypedValue(string typename, dynamic? value,
+            string prefix = GraphSONTokens.GremlinTypeNamespace)
         {
             var typedValue = new Dictionary<string, dynamic>
             {
@@ -67,8 +71,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         internal static Dictionary<string, dynamic> ToCollection(dynamic objectData, GraphSONWriter writer,
                                                                string typename)
         {
-            var collection = objectData as IEnumerable;
-            if (collection == null)
+            if (objectData is not IEnumerable collection)
             {
                 throw new InvalidOperationException("Object must implement IEnumerable");
             }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
index dd4fa27..a766c45 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -39,15 +41,14 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     /// </summary>
     public abstract class GraphSONWriter
     {
-        private static readonly JsonSerializerOptions _jsonOptions = new JsonSerializerOptions
+        private static readonly JsonSerializerOptions JsonOptions = new()
             {Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping};
         
         /// <summary>
         /// Contains the information of serializers by type.
         /// </summary>
-        protected readonly Dictionary<Type, IGraphSONSerializer> Serializers = new Dictionary
-            <Type, IGraphSONSerializer>
-            {
+        protected readonly Dictionary<Type, IGraphSONSerializer> Serializers = new()
+        {
                 {typeof(ITraversal), new TraversalSerializer()},
                 {typeof(Bytecode), new BytecodeSerializer()},
                 {typeof(Binding), new BindingSerializer()},
@@ -106,7 +107,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// <returns>The serialized GraphSON.</returns>
         public virtual string WriteObject(dynamic objectData)
         {
-            return JsonSerializer.Serialize(ToDict(objectData), _jsonOptions);
+            return JsonSerializer.Serialize(ToDict(objectData), JsonOptions);
         }
 
         /// <summary>
@@ -114,7 +115,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// </summary>
         /// <param name="objectData">The object to transform.</param>
         /// <returns>A GraphSON representation of the object ready to be serialized.</returns>
-        public dynamic ToDict(dynamic objectData)
+        public dynamic? ToDict(dynamic? objectData)
         {
             if (objectData != null)
             {
@@ -132,7 +133,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             return objectData;         
         }
 
-        private IGraphSONSerializer TryGetSerializerFor(Type type)
+        private IGraphSONSerializer? TryGetSerializerFor(Type type)
         {
             if (Serializers.ContainsKey(type))
             {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONDeserializer.cs
index e0c4993..bb71715 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONDeserializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -36,6 +38,6 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         /// <param name="graphsonObject">The GraphSON object to objectify.</param>
         /// <param name="reader">A <see cref="GraphSONReader" /> that can be used to objectify properties of the GraphSON object.</param>
         /// <returns>The deserialized object.</returns>
-        dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader);
+        dynamic? Objectify(JsonElement graphsonObject, GraphSONReader reader);
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONSerializer.cs
index f5faf84..2403e9c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/IGraphSONSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
index 6182de9..2687bb5 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int32Converter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int32Converter.cs
index 6cdcdfd..5d5cf50 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int32Converter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int32Converter.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int64Converter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int64Converter.cs
index c0192a8..18972be 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int64Converter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int64Converter.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/LambdaSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/LambdaSerializer.cs
index 45e4632..a436250 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/LambdaSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/LambdaSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ListSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ListSerializer.cs
index add8eb5..674cff4 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ListSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ListSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Text.Json;
 
@@ -36,7 +38,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             {
                 return EmptyList;
             }
-            var result = new object[graphsonObject.GetArrayLength()];
+            var result = new object?[graphsonObject.GetArrayLength()];
             for (var i = 0; i < result.Length; i++)
             {
                 result[i] = reader.ToObject(graphsonObject[i]);
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/MapSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/MapSerializer.cs
index 99165a7..be10a2c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/MapSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/MapSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -36,7 +38,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             {
                 return new Dictionary<object, object>(0);
             }
-            var result = new Dictionary<object, object>(graphsonObject.GetArrayLength() / 2);
+            var result = new Dictionary<object, object?>(graphsonObject.GetArrayLength() / 2);
             for (var i = 0; i < graphsonObject.GetArrayLength(); i += 2)
             {
                 result[reader.ToObject(graphsonObject[i])] = reader.ToObject(graphsonObject[i + 1]);
@@ -47,11 +49,11 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         
         public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
         {
-            if (!(objectData is IDictionary map))
+            if (objectData is not IDictionary map)
             {
                 throw new InvalidOperationException("Object must implement IDictionary");
             }
-            var result = new object[map.Count * 2];
+            var result = new object?[map.Count * 2];
             var index = 0;
             foreach (var key in map.Keys)
             {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
index 4492685..40338f0 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Globalization;
 using System.Text.Json;
@@ -28,6 +30,7 @@ using System.Text.Json;
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
     internal abstract class NumberConverter<T> : IGraphSONDeserializer, IGraphSONSerializer
+        where T : notnull
     {
         protected abstract string GraphSONTypeName { get; }
         protected virtual string Prefix => "g";
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PSerializer.cs
index 46facda..3d3c4d6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Path3Deserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Path3Deserializer.cs
index d05663b..2913543 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Path3Deserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Path3Deserializer.cs
@@ -21,7 +21,10 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text.Json;
 
@@ -32,12 +35,14 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
             // "labels" is a object[] where each item is ISet<object>
-            var labelProperty = (object[])reader.ToObject(graphsonObject.GetProperty("labels"));
+            var labelProperty = (object[]?) reader.ToObject(graphsonObject.GetProperty("labels"));
+            if (labelProperty == null) throw new IOException($"Could not read the labels for the {nameof(Path)}");
             var labels = labelProperty
                 .Select(x => new HashSet<string>(((ISet<object>)x).Cast<string>()))
                 .ToList<ISet<string>>();
-            // "objects" is an object[]
-            object[] objects = reader.ToObject(graphsonObject.GetProperty("objects"));
+            // "objects" is an object?[]
+            object?[] objects = reader.ToObject(graphsonObject.GetProperty("objects")) ??
+                                throw new IOException($"Could not read the objects for the {nameof(Path)}");
             return new Path(labels, objects);
         }
     }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PathDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PathDeserializer.cs
index 3a37f66..2a84eba 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PathDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PathDeserializer.cs
@@ -21,7 +21,10 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text.Json;
 
@@ -34,7 +37,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             var labels =
                 graphsonObject.GetProperty("labels").EnumerateArray()
                     .Select(readObjLabels =>
-                        new HashSet<string>(readObjLabels.EnumerateArray().Select(l => l.GetString())))
+                        new HashSet<string>(readObjLabels.EnumerateArray().Select(l =>
+                            l.GetString() ?? throw new IOException("Read null but expected a Path label"))))
                     .ToList<ISet<string>>();
             var objects = graphsonObject.GetProperty("objects").EnumerateArray().Select(o => reader.ToObject(o))
                 .ToList();
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs
index 7c9ea0c..8f95662 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertyDeserializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertySerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertySerializer.cs
index 0a7e6f8..e23a17d 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertySerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/PropertySerializer.cs
@@ -21,7 +21,10 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
+using System.IO;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
@@ -40,11 +43,16 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             return GraphSONUtil.ToTypedValue(nameof(Property), valueDict);
         }
 
-        private dynamic CreateElementDict(Element element, GraphSONWriter writer)
+        private dynamic? CreateElementDict(Element? element, GraphSONWriter writer)
         {
             if (element == null)
                 return null;
             var serializedElement = writer.ToDict(element);
+            if (serializedElement == null)
+            {
+                throw new IOException(
+                    $"Could not write the {nameof(Property.Element)} of this {nameof(Property)}, {nameof(Property.Element)}: {element}");
+            }
             Dictionary<string, dynamic> elementDict = serializedElement;
             if (elementDict.ContainsKey(GraphSONTokens.ValueKey))
             {
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/RequestMessageSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/RequestMessageSerializer.cs
index 396de01..372d9b6 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/RequestMessageSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/RequestMessageSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Driver.Messages;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/SetSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/SetSerializer.cs
index 590392e..b504c35 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/SetSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/SetSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using System.Linq;
 using System.Text.Json;
@@ -36,7 +38,7 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 return new HashSet<object>();
             }
             // ISet<object>
-            return new HashSet<object>(graphsonObject.EnumerateArray().Select(reader.ToObject));
+            return new HashSet<object?>(graphsonObject.EnumerateArray().Select(reader.ToObject));
         }
 
         public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TDeserializer.cs
index efbc542..1d5c5ea 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TDeserializer.cs
@@ -21,6 +21,9 @@
 
 #endregion
 
+#nullable enable warnings
+
+using System.IO;
 using System.Text.Json;
 using Gremlin.Net.Process.Traversal;
 
@@ -30,7 +33,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
     {
         public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader)
         {
-            return T.GetByValue(graphsonObject.GetString());
+            return T.GetByValue(graphsonObject.GetString() ??
+                                throw new IOException($"Read null but expected a {nameof(T)} string representation"));
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TextPSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TextPSerializer.cs
index 586be2d..e00ed0b 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TextPSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TextPSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalSerializer.cs
index cc809aa..08e0e46 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalSerializer.cs
@@ -21,7 +21,10 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
+using System.IO;
 using Gremlin.Net.Process.Traversal;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -32,7 +35,13 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         {
             ITraversal traversal = objectData;
             var bytecode = traversal.Bytecode;
-            return writer.ToDict(bytecode);
+            var dictifiedObject = writer.ToDict(bytecode);
+            if (dictifiedObject == null)
+            {
+                throw new IOException(
+                    $"Could not write the traversal as its {nameof(ITraversal.Bytecode)} was written as null");
+            }
+            return dictifiedObject;
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalStrategySerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalStrategySerializer.cs
index 9b70978..bb59cd0 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalStrategySerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraversalStrategySerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 using Gremlin.Net.Process.Traversal.Strategy;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraverserReader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraverserReader.cs
index 1997325..b97b91d 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraverserReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/TraverserReader.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 using Gremlin.Net.Process.Traversal;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidDeserializer.cs
index 58caac7..212e2c1 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidDeserializer.cs
@@ -21,7 +21,10 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
+using System.IO;
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -32,7 +35,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
         {
             var uuidString = graphsonObject.GetString();
 
-            return Guid.Parse(uuidString);
+            return Guid.Parse(
+                uuidString ?? throw new IOException("Read null but expected a GUID string representation"));
         }
     }
 }
\ No newline at end of file
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidSerializer.cs
index 5f31bfc..fd5894c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/UuidSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System;
 using System.Collections.Generic;
 
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs
index 72615ef..8ff01d5 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexDeserializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs
index 15a99dc..79332ff 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertyDeserializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Text.Json;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertySerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertySerializer.cs
index 12cc7ac..5f42528 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertySerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexPropertySerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
@@ -34,9 +36,12 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             {
                 {"id", writer.ToDict(vertexProperty.Id)},
                 {"label", vertexProperty.Label},
-                {"value", writer.ToDict(vertexProperty.Value)},
-                {"vertex", writer.ToDict(vertexProperty.Vertex.Id)}
+                {"value", writer.ToDict(vertexProperty.Value)}
             };
+            if (vertexProperty.Vertex != null)
+            {
+                valueDict.Add("vertex", writer.ToDict(vertexProperty.Vertex.Id));
+            }
             return GraphSONUtil.ToTypedValue(nameof(VertexProperty), valueDict);
         }
     }
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexSerializer.cs
index d3ad9f1..f73e72f 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/VertexSerializer.cs
@@ -21,6 +21,8 @@
 
 #endregion
 
+#nullable enable warnings
+
 using System.Collections.Generic;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs
index e60c1bd..8ad5b82 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/Path.cs
@@ -39,14 +39,14 @@ namespace Gremlin.Net.Structure
     ///     In abstraction, any Path implementation maintains two lists: a list of sets of labels and a list of objects.
     ///     The list of labels are the labels of the steps traversed. The list of objects are the objects traversed.
     /// </remarks>
-    public class Path : IReadOnlyList<object>, IEquatable<Path>
+    public class Path : IReadOnlyList<object?>, IEquatable<Path>
     {
         /// <summary>
         ///     Initializes a new instance of the <see cref="Path" /> class.
         /// </summary>
         /// <param name="labels">The labels associated with the path</param>
         /// <param name="objects">The objects in the <see cref="Path" />.</param>
-        public Path(IList<ISet<string>> labels, IList<object> objects)
+        public Path(IList<ISet<string>> labels, IList<object?> objects)
         {
             Labels = labels;
             Objects = objects;
@@ -60,7 +60,7 @@ namespace Gremlin.Net.Structure
         /// <summary>
         ///     Gets an ordered list of the objects in the <see cref="Path" />.
         /// </summary>
-        public IList<object> Objects { get; }
+        public IList<object?> Objects { get; }
 
         /// <summary>
         ///     Gets the object associated with the particular label of the path.
@@ -93,7 +93,7 @@ namespace Gremlin.Net.Structure
         /// </summary>
         /// <param name="index">The index of the path</param>
         /// <returns>The object associated with the index of the path</returns>
-        public dynamic this[int index] => Objects[index];
+        public dynamic? this[int index] => Objects[index];
 
         /// <summary>
         ///     Gets the number of steps in the path.
@@ -142,15 +142,15 @@ namespace Gremlin.Net.Structure
                 if (!Labels[i].Contains(label)) continue;
                 if (value == null)
                     value = Objects[i];
-                else if (value.GetType() == typeof(List<object>))
-                    ((List<object>) value).Add(Objects[i]);
+                else if (value.GetType() == typeof(List<object?>))
+                    ((List<object?>) value).Add(Objects[i]);
                 else
-                    value = new List<object> {value, Objects[i]};
+                    value = new List<object?> {value, Objects[i]};
             }
             return value != null;
         }
 
-        private bool ObjectsEqual(ICollection<object> otherObjects)
+        private bool ObjectsEqual(ICollection<object?> otherObjects)
         {
             return Objects.SequenceEqual(otherObjects);
         }
@@ -163,6 +163,10 @@ namespace Gremlin.Net.Structure
             using var enumThis = Labels.GetEnumerator();
             while (enumOther.MoveNext() && enumThis.MoveNext())
             {
+                if (enumOther.Current == null || enumThis.Current == null)
+                {
+                    return enumOther.Current != enumThis.Current;
+                }
                 if (!enumOther.Current.SequenceEqual(enumThis.Current))
                 {
                     return false;
@@ -190,7 +194,8 @@ namespace Gremlin.Net.Structure
                 hashCode = Labels.Aggregate(hashCode,
                         (current1, objLabels) => objLabels.Aggregate(current1,
                             (current, label) => current * 31 + label.GetHashCode()));
-                hashCode = Objects.Aggregate(hashCode, (current, obj) => current * 31 + obj.GetHashCode());
+                hashCode = Objects.Aggregate(hashCode,
+                    (current, obj) => current * 31 + (obj == null ? 0 : obj.GetHashCode()));
                 return hashCode;
             }
         }
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index 0b99652..bf7624f 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@ -156,7 +156,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
             new List<object[]>
             {
                 new object[] {new GraphBinaryMessageSerializer()},
-                // new object[] {new GraphSON3MessageSerializer()}
+                new object[] {new GraphSON3MessageSerializer()}
             };
 
         private void WriteOutput(string line)
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Driver/GraphSONMessageSerializerTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Driver/GraphSONMessageSerializerTests.cs
index 6b7951f..39e393e 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Driver/GraphSONMessageSerializerTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Driver/GraphSONMessageSerializerTests.cs
@@ -22,6 +22,7 @@
 #endregion
 
 using System;
+using System.IO;
 using System.Text;
 using System.Threading.Tasks;
 using Gremlin.Net.Structure.IO.GraphSON;
@@ -40,31 +41,29 @@ namespace Gremlin.Net.UnitTest.Driver
         }
 
         [Fact]
-        public async Task EmptyArrayDeserializedIntoNull()
+        public async Task DeserializingEmptyArrayThrows()
         {
             var sut = CreateMessageSerializer();
-
-            var result = await sut.DeserializeMessageAsync(new byte[0]);
             
-            Assert.Null(result);
+            await Assert.ThrowsAsync<IOException>(()=> sut.DeserializeMessageAsync(new byte[0]));
         }
 
         [Fact]
-        public async Task EmptyStringDeserializedIntoNull()
+        public async Task DeserializingEmptyStringThrows()
         {
             var sut = CreateMessageSerializer();
             var ofEmpty = Encoding.UTF8.GetBytes("");
 
-            Assert.Null(await sut.DeserializeMessageAsync(ofEmpty));
+            await Assert.ThrowsAsync<IOException>(()=> sut.DeserializeMessageAsync(ofEmpty));
         }
 
         [Fact]
-        public async Task JsonNullDeserializedIntoNull()
+        public async Task DeserializingJsonNullThrows()
         {
             var sut = CreateMessageSerializer();
             var ofNull = Encoding.UTF8.GetBytes("null");
 
-            Assert.Null(await sut.DeserializeMessageAsync(ofNull));
+            await Assert.ThrowsAsync<IOException>(()=> sut.DeserializeMessageAsync(ofNull));
         }
 
         private static GraphSONMessageSerializer CreateMessageSerializer()
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index ce593f7..31bc733 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@ -410,6 +410,19 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
                 "{\"@type\":\"g:VertexProperty\",\"@value\":{\"id\":\"blah\",\"label\":\"keyA\",\"value\":true,\"vertex\":\"stephen\"}}";
             Assert.Equal(expected, graphSON);
         }
+        
+        [Theory, MemberData(nameof(Versions))]
+        public void ShouldSerializeVertexPropertyWithoutVertex(int version)
+        {
+            var writer = CreateGraphSONWriter(version);
+            var vertexProperty = new VertexProperty("blah", "keyA", true);
+
+            var graphSON = writer.WriteObject(vertexProperty);
+
+            const string expected =
+                "{\"@type\":\"g:VertexProperty\",\"@value\":{\"id\":\"blah\",\"label\":\"keyA\",\"value\":true}}";
+            Assert.Equal(expected, graphSON);
+        }
 
         [Theory, MemberData(nameof(Versions))]
         public void ShouldSerializeGuid(int version)