smurfy / mwo-api-sample

Api sample for mwo.smurfy-net.de
14 stars 5 forks source link

Feature Request: Inconsistent serialization causes issues for typed languages #4

Closed AnthonyClink closed 10 years ago

AnthonyClink commented 10 years ago

Hello!

So far I am very pleased with the very simple yet powerful api provided for MWO.

My only issue is on typed languages when trying to serialize the http:/mwo.smurfy-net.de/api/data/mechs.json payload, there is a slight descrepency in the way jump_jets are handled in the Details object of a mech entry.

Current State: On chassis with jump jet capability the mechList.id.details.jump_jets property is set to a positive numerical value indicating the amount of jump jets capable of the chassis.

On chassis without jump jet capability the mechList.id.details.jump_jets property is set to false.

Desired State: On chassis with jump jet capability the property is set to the max number of jump jets allowed on the chassis or true representing the fact that the chassis allows them.

On chassis without jump jet capability the property is set to zero or negative one, null, undefined or the string values of any of the previous value types. These types are derived through unit testing a few various json parsers in c# and Java; these seem to work in most cases.

Boolean seems to only deserialize correctly in small edge cases which require various levels configuration.

Thank you

smurfy commented 10 years ago

Thank you, will be live on the next deployment.

The jj property will be 0 (zero) if chassis is not capable of using jj's.