How to serialize java.nio.file.Path with Gson?
问题 I get java.lang.StackOverflowError when trying to serialize Object that contains java.nio.file.Path Even when i wrote: public class PathConverter implements JsonDeserializer<Path>, JsonSerializer<Path> { @Override public Path deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { return Paths.get(jsonElement.getAsString()); } @Override public JsonElement serialize(Path path, Type type, JsonSerializationContext