YAML unlike JSON allows integer keys.
>> asdf.AsdfFile({42: 'foo'})[42]
'foo'
The specification mentions support for JSON pointer style references.
>> af = asdf.AsdfFile({'foo': 42, 'ref': {'$ref': '#foo'}})
>> af.resolve_references()
>> af['ref']
42
However the following example fails:
>> af = asdf.AsdfFile({0: 'a', 'ref': {'$ref': '#0'}})
>> af.resolve_references()
ValueError: Unresolvable reference: '0'
Perhaps the implementation is wrong and the "0" string fragment should be converted to an integer. However with the following example that would mean it is impossible to reference 'b' (where currently the python asdf returns 'b').
>> af = asdf.AsdfFile({0: 'a', '0': 'b', 'ref': {'$ref': '#0'}})
>> af.resolve_references()
>> af['ref']
'b'
Perhaps this is additional evidence for the removal of JSON pointer: #444
YAML unlike JSON allows integer keys.
The specification mentions support for JSON pointer style references.
However the following example fails:
Perhaps the implementation is wrong and the "0" string fragment should be converted to an integer. However with the following example that would mean it is impossible to reference 'b' (where currently the python asdf returns 'b').
Perhaps this is additional evidence for the removal of JSON pointer: #444