number is an very ambiguous term.
It would be helpful if there was an indication of values that can return as non-integral.
In a javascript context this is not an issue, but most devs, myself included, need to know when to use an int/long vs double/decimal in order to properly define schemas and objects.
a possible solution would be to follow MS format and indicate with an integer flag.
update:
yes, I understand that you are returning a 'number' so technically the spec is correct. but what good does that do your audience?
Should I make every object field and database column a float so it doesn't break unexpectedly because I guessed wrong what datatype I should use?
Sure, I can guess, and correctly in most cases, but you are not guessing and your data fields are not all floats - are you picking up what I am putting down?
number is of questionable value to all but the most trivial applications of the api and downgrading the spec because of the limitations of transport is a mistake in my opinion.
decimaldo a developer working in javascript?float,real,double, etc. are all constructs of particular languages;numberat least has a concrete meaning in context. – Kevin Montrose♦ Jun 1 '10 at 21:53decimaldoesn't exist in Java as a primitive type;realis pretty vague; lets not even get started onstrictfp. I'm just saying, its a lot more complicated than you're making it out to be. integral/non-integral even raises some length issues (dates > 32 bits, most everything else <= 32 bits; signed/unsigned is another question). – Kevin Montrose♦ Jun 1 '10 at 22:56numberneeds to be made more specific, but doing so is non-trivial and accordingly will take some time. – Kevin Montrose♦ Jun 2 '10 at 0:32