Whilst struggling with getting serialization working as expected during testing I noticed that the following method does not work as expected:
Specifically this code:
It suggests that the string argument being used should be a MIME type like "application/json" but due to how the method Serializers.valueOf() works it in fact checks the enum name value.
See the class org.apache.tinkerpop.gremlin.driver.ser.Serializers for some context.
The valueOf method checks against the name of the enum which for the "appliction/json" example would actually be "GRAPHSON".
There is a property called value and function called getValue() that were probably the intended targets for matching against.
A solution for this would be to simply check against each enum instance's value property via the getter method mentioned earlier. Something like this:
You could extract this (or the matching part of it) into a static method on the Serializers enum type if such a matching pattern is common.