File tree Expand file tree Collapse file tree
src/main/java/org/comroid/api/data/seri/adp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ public enum Jackson implements Serializer<JSON.Node> {
1818 @ Override
1919 @ SneakyThrows
2020 public @ Nullable JSON .Node parse (@ Language ("JSON" ) @ Nullable String data ) {
21- final var mapper = Context .root ().getFromContext (ObjectMapper .class , true ).assertion ( );
21+ final var mapper = Context .root ().getFromContext (ObjectMapper .class , true ).orElseGet ( ObjectMapper :: new );
2222
2323 //noinspection unchecked
2424 return data == null
2525 ? DataNode .Value .NULL .json ()
2626 : data .trim ().startsWith ("{" )
27- ? org .comroid .api .data .seri .adp .JSON .Object .of (mapper .readValue (data ,
28- Map . class ) )
29- : data . trim (). startsWith ( "[" ) ? org .comroid .api .data .seri .adp .JSON .Array .of (mapper .readValue (data ,
30- List . class )) : DataNode .of (mapper .readTree (data )).json ();
27+ ? org .comroid .api .data .seri .adp .JSON .Object .of (mapper .readValue (data , Map . class ))
28+ : data . trim (). startsWith ( "[" )
29+ ? org .comroid .api .data .seri .adp .JSON .Array .of (mapper .readValue (data , List . class ))
30+ : DataNode .of (mapper .readTree (data )).json ();
3131 }
3232
3333 @ Override
You can’t perform that action at this time.
0 commit comments