Json 我的响应是扩展jersey响应。如何排除其他字段并仅发送模型类对象作为响应?

Json 我的响应是扩展jersey响应。如何排除其他字段并仅发送模型类对象作为响应?,json,rest,jersey,raml,Json,Rest,Jersey,Raml,在此响应中,它包括jersey响应类中的所有字段。如何从响应中删除这些字段并仅发送实体作为响应对象 我已经使用RAML生成了我的接口和模型类。所以在内部,我的响应对象扩展了jersey响应类 { "length": -1, "language": null, "location": null, "allowedMethods": [], "metadata": { "Content-Type": [

在此响应中,它包括jersey响应类中的所有字段。如何从响应中删除这些字段并仅发送实体作为响应对象

我已经使用RAML生成了我的接口和模型类。所以在内部,我的响应对象扩展了jersey响应类

{
      "length": -1,
      "language": null,
      "location": null,
      "allowedMethods": [],
      "metadata": {
        "Content-Type": [
          "application/json"
        ]
      },
      "mediaType": {
        "type": "application",
        "subtype": "json",
        "parameters": {},
        "wildcardType": false,
        "wildcardSubtype": false
      },
      "status": 200,
      "date": null,
      "headers": {
        "Content-Type": [
          "application/json"
        ]
      },//Response obj
      "entity": {
        "user": "abcd",
        "password": "xyz123",
        "group": "mail"
      },
      "lastModified": null,
      "cookies": {},
      "links": [],
      "statusInfo": "OK",
      "entityTag": null,
      "stringHeaders": {
        "Content-Type": [
          "application/json"
        ]
      }
    }

您的资源方法签名是什么样子的?返回类型是
Response
还是您的扩展类型?我认为这很重要。请用你的模型课更新这个问题