How to get the underlying String from a JsonParser (Jackson Json)

后端 未结 5 2090
囚心锁ツ
囚心锁ツ 2021-02-18 15:23

Looking through the documentation and source code I don\'t see a clear way to do this. Curious if I\'m missing something.

Say I receive an InputStream from a server resp

5条回答
  •  有刺的猬
    2021-02-18 16:07

    If you have the JsonParser then you can use jsonParser.readValueAsTree().toString().

    However, this likely requires that the JSON being parsed is indeed valid JSON.

提交回复
热议问题