Roan Kattouw schreef:
> Brion Vibber schreef:
>   
>> Hmm, a related problem I see is that numeric strings aren't quoted. If
>> I'm reading things properly, that means that, say, a page named "123"
>> will decode with an integer value for the 'title' field instead of a
>> string value.
>>
>> While some scripting languages will happily convert automatically
>> between integer and string types, others are pretty picky about this.
>>   
>>     
> That's a generic problem which occurs with JSON and possibly other 
> formats as well. I'll try to fix it, but with PHP's weak typing system 
> it could be impossible.
Turns out I wasn't entirely correct.

JSON handles "123" vs. 123 just fine. However, YAML has a simple string 
format that doesn't require quotes (only works if the string doesn't 
contain stuff that has to be escaped), as in:

foo:   bar
baz:   3

Because of this, there's no way to tell the string "3" from the integer 
3 because both are encoded exactly the same. If people are having 
trouble with this, they should file a bug at Bugzilla and I'll use the 
literal format for numerical strings as well.

Roan Kattouw (Catrope)

_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to