egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
371 stars 65 forks source link

Fix DeserializeError, UrlEntity::expanded_url -> Nullable String #54

Closed innerand closed 5 years ago

innerand commented 5 years ago

The extended URL of a URL entity may be null.

innerand commented 5 years ago

Should fix issue https://github.com/QuietMisdreavus/twitter-rs/issues/51

klausi commented 5 years ago

Thanks a lot, just ran into the same problem!

I think the fix is not correct, if the exanded_url is null then I want to know about it as a consumer. That would mean we should implement this as Option.

klausi commented 5 years ago

Opened #56 as alternative to this pull request.

adwhit commented 5 years ago

I would tend to agree that if a field is nullable it should be represented as an option. There are a few instances of just using a default if a field is missing but I think this should only happen when it is an extremely rare occurrence for it to be null and the ergonomic hit is just too annoying. I don't think this is one of those cases so going to close in favour of #56