0

我正在尝试使用http://www.jsonschema2pojo.org/将提到的部分 JSON 响应从预测 api 转换为 POJO 。当我尝试将其转换为 pojo 时,错误说

There's a problem: Unexpected character ('l' (code 108)): was expecting double-quote to start field name (line 2, column 2)

现在我看到我需要在 json 响应的每个关键参数上加上双引号。所以我手动输入双引号,然后我得到 pojo 类。所以我的问题是我是否必须每次都这样做并对每个键应用双引号?我还缺少其他任何技巧吗?

 {
  latitude: 45.4925827,
  longitude: -73.57789,
  timezone: "America/Montreal",
  offset: -4,
  currently: {
  time: 1496155473,
  summary: "Clear",
  icon: "clear-day",
  nearestStormDistance: 12,
  nearestStormBearing: 155,
  precipIntensity: 0,
  precipProbability: 0,
  temperature: 63.32,
  apparentTemperature: 63.32,
  dewPoint: 57.94,
  humidity: 0.83,
  windSpeed: 9.87,
  windBearing: 152,
  visibility: 10,
  cloudCover: 0.14,
  pressure: 1015.05,
  ozone: 346.1
  }
 }
4

0 回答 0