tuomur / python-odata

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

Zero-length string for name of enumtype members is not supported #31

Open rroos80 opened 6 years ago

rroos80 commented 6 years ago

In metadata.py, get_entity_sets() will create EnumTypes for all name/value pairs of enumtype members.

If the name of the enumtype memer is a zero-length string, creating the enumtype will cause an exception as _is_sunder() in enum.py cannot check for name[0] as it doesn't exist.

I'm not quite sure where the best place would be to fix this. I'm currently using a workaround of converting the name of the enumtype to a single space character, but that's obviously not quite right.

I don't have any control over the OData interface I'm querying, and I'm at a loss of why someone would name a Enumtype member with a zero length string in the first place, but this is what I'm dealing with. Any suggestions welcome!