Closed bunker-inspector closed 5 years ago
Would rather not change it to a Value, looks to me like one of those classic, either empty list or object ones have you seen it give a non-empty list ever?
there is a function optional_struct_or_empty_array
that handles this case specifically for UserProfile.fields and i suggest this is another case for it
That's a good point. I have only seen it as an empty list. The docs are unclear on what the bot field can look like so I figured it was possible. I'll try what you suggested when I have a chance
Updated. That function did the trick :+1:
Sorry forgot to mention, that file you've changed is actually generated and shouldn't be changed manually unless you want your changes to be lost next time it's generated. The file you'll want to change is here, it captures the special cases (hacks) that are expressed nicely in the json schema.
https://github.com/slack-rs/slack-rs-api/blob/master/codegen/src/json_schema.rs#L158
then running code gen will update src/types.rs
could really do with the generator adding a massive comment at the top saying "oi this is generated"
Accident or resubmitting?
I have a pr that fixes this, if you would still like to submit one, as it is your contribution, you can if you wish https://github.com/slack-rs/slack-rs-api/pull/68
I tracked this down after the slackbot for a team I'm a part of stopped working. It appears that this field doesn't guarantee any real consistent format. For example, here are some of the results from my
rtm.start
command.