VD02: Bad number type in JSON object response
Looking at the example values for VD02 (Similar results observed when actually calling the API) with msgtype: jsono (applies to json too), the returned data is (formatted):
{
"METADATA": {
"TOTAL_RESULTS": 1,
"TOTAL_PAGES": 1,
"CURRENT_PAGE": 1
},
"DATA": [
{
"MMSI": "275507000",
"IMO": "9375783",
"NAME": "LIBERO",
"PLACE_OF_BUILD": "",
"BUILD": "2006",
"BREADTH_EXTREME": "12.4",
"SUMMER_DWT": "2930",
"DISPLACEMENT_SUMMER": "",
"CALLSIGN": "YLPS",
"FLAG": "LV",
"DRAUGHT": "4.36",
"LENGTH_OVERALL": "88.53",
"FUEL_CONSUMPTION": "",
"SPEED_MAX": "",
"SPEED_SERVICE": "10.5",
"LIQUID_OIL": "",
"OWNER": "BOJEN",
"MANAGER": "BOJEN",
"FINANCIAL_OWNER": "",
"TECHNICAL_MANAGER": "",
"VESSEL_TYPE": "GENERAL CARGO"
}
]
}
All values are quoted as string, despite some response fields having numeric types (integer and real).
{
"METADATA": {
"TOTAL_RESULTS": 1,
"TOTAL_PAGES": 1,
"CURRENT_PAGE": 1
},
"DATA": [
{
"MMSI": "275507000",
"IMO": "9375783",
"NAME": "LIBERO",
"PLACE_OF_BUILD": "",
"BUILD": "2006",
"BREADTH_EXTREME": 12.4,
"SUMMER_DWT": 2930,
"DISPLACEMENT_SUMMER": null,
"CALLSIGN": "YLPS",
"FLAG": "LV",
"DRAUGHT": 4.36,
"LENGTH_OVERALL": 88.53,
"FUEL_CONSUMPTION": "",
"SPEED_MAX": null,
"SPEED_SERVICE": 10.5,
"LIQUID_OIL": null,
"OWNER": "BOJEN",
"MANAGER": "BOJEN",
"FINANCIAL_OWNER": "",
"TECHNICAL_MANAGER": "",
"VESSEL_TYPE": "GENERAL CARGO"
}
]
}
Notice all number fields are not quoted and missing values which were before empty string are now null.
By comparision with the competition, vesselfinder returns a JSON with correct types.
Is there a way to get a JSON with the correct types, or is this planned in the near future?
Thanks for your help.
Please sign in to leave a comment.
Comments
3 comments