Using Jackson, how can a list of known JSON properties be obtained for any arbitrary pojo class?

前端 未结 4 1293
暖寄归人
暖寄归人 2020-12-20 18:40

Ideally, it would look much like this:

List props = objectMapper.getKnownProperties(MyPojo.class);

Alas, there is no such met

4条回答
  •  清酒与你
    2020-12-20 19:25

    Perhaps you could use Jackson's JSON Schema module to generate a schema for a class, then inspect the schema.

提交回复
热议问题