dbopendata / db-fahrplan-api

DB Fahrplan API
31 stars 1 forks source link

Output arrays without intermediate object in JSON #6

Open highsource opened 8 years ago

highsource commented 8 years ago

Bei JourneyDetail ( Stops -> Stop -> [ ] ) sollte das Array direkt in Stops sein ( Stops -> [ ] ). Dies gilt auch für andere Felder.

http://data.deutschebahn.com/apis/fahrplan/#comment-2538938311

highsource commented 8 years ago
{
"JourneyDetail":{
  "noNamespaceSchemaLocation":"http://open-api.bahn.de/bin/rest.exe/v1.0/xsd?name=hafasRestJourneyDetail.xsd",
  "Stops":{
    "Stop":[{
      "name":"Hamburg-Altona",
      "id":"8002553",
      "lon":"9.935174",
      "lat":"53.552696",
      "routeIdx":"0",
      "depTime":"11:09",
      "depDate":"2016-02-25",
      "track":"11"
      },{
      "name":"Hamburg Dammtor",
      "id":"8002548",
      "lon":"9.989568",
      "lat":"53.560751",
      "routeIdx":"1",
      "arrTime":"11:15",
      "arrDate":"2016-02-25",
      "depTime":"11:17",
      "depDate":"2016-02-25",
      "track":"4"
      }, ...]
    },
  "Names":{
    "Name":{
      "name":"ICE 577",
      "routeIdxFrom":"0",
      "routeIdxTo":"9"
      }
    },
  "Types":{
    "Type":{
      "type":"ICE",
      "routeIdxFrom":"0",
      "routeIdxTo":"9"
      }
    },
  "Operators":{
    "Operator":{
      "name":"DPN",
      "routeIdxFrom":"0",
      "routeIdxTo":"9"
      }
    },
  "Notes":{
    "Note":{
      "key":"BR",
      "priority":"450",
      "routeIdxFrom":"0",
      "routeIdxTo":"9",
      "$":"Bordrestaurant"
      }
    }
  }
}

All these intermediate Stops, Names, Types etc. are totally unnecessary.