tuomur / python-odata

A simple library for read/write access to OData services
MIT License
79 stars 59 forks source link

Value of enumtype members should not be converted from string to int when parsing #30

Open rroos80 opened 6 years ago

rroos80 commented 6 years ago

In metadata.py, _parse_enumtype() will go through all members of an enumtype_element and append the name/value pairs to enum['members']. It will convert all string values to int, which causes problems later-on in get_entity_sets() when EnumType is called.

Feel free to correct me on this, but in trying to parse a large OData interface I've come across this issue and it made me wonder why the conversion is taking place in the first case. I've removed the conversion in my local copy for now.

tpow commented 5 years ago

@rroos80 Can you explain this more or include an example EnumType from the OData interface that was having problems with the conversion?

According to the OData 4 spec, it looks like all EnumTypes have numeric values.