0

誰かがこの問題に遭遇したことがありますjackson JSONか?どういうわけか、JSON私のクラスの各フィールドタイプ、および私が興味のない他のメタデータが含まれているため、送信されるデータは膨大です!

たとえば、これは1つのレコードです。

{
    "queue": "H",
    "internalStatus": "New",
    "id": "50030386",
    "screenDescription": "Test Case 1",

}
},
"fields": [
{
    "name": "id",
    "type": "java.lang.Integer",
    "modifiers": 2,
    "annotations": [

    ],
    "declaredAnnotations": [

    ],
    "declaringClass": "com.me.Charge",
    "synthetic": false,
    "genericType": "java.lang.Integer",
    "enumConstant": false,
    "accessible": false
},
{
    "name": "screenDescription",
    "type": "java.lang.String",
    "modifiers": 2,
    "annotations": [

    ],
    "declaredAnnotations": [

    ],
    "declaringClass": "com.me.Charge",
    "synthetic": false,
    "genericType": "java.lang.String",
    "enumConstant": false,
    "accessible": false
},
{
    "name": "internalStatus",
    "type": "java.lang.String",
    "modifiers": 2,
    "annotations": [

    ],
    "declaredAnnotations": [

    ],
    "declaringClass": "com.me.Charge",
    "synthetic": false,
    "genericType": "java.lang.String",
    "enumConstant": false,
    "accessible": false
},
{
    "name": "queue",
    "type": "java.lang.String",
    "modifiers": 2,
    "annotations": [

    ],
    "declaredAnnotations": [

    ],
    "declaringClass": "com.me.Charge",
    "synthetic": false,
    "genericType": "java.lang.String",
    "enumConstant": false,
    "accessible": false
},

どんな助けでも大歓迎です。

ありがとう、スティーブン

4

1 に答える 1

0

コードを確認して設定してください

objectMapper.enableDefaultTyping(...)

ある値に…

于 2012-11-27T11:42:00.713 に答える