The generated client code for rust has a few problems:
Box<dyn Future<Item = ::std::collections::HashMap<String, serde_json::Value>, Error = Error<serde_json::Value>>>
The models are properly generated but the return type of the methods don't reference the generated models at all.
openapi-generator-cli 5.0.0-SNAPSHOT
commit : 46216cd
built : 2020-04-28T13:03:54Z
source : https://github.com/openapitools/openapi-generator
docs : https://openapi-generator.tech/
OpenAPI declaration file content or url
https://api.slack.com/specs/openapi/v2/slack_web.json
Command line used for generationjava -jar ~/Downloads/openapi.jar generate -g rust -i https://api.slack.com/specs/openapi/v2/slack_web.json -o rust
run the command above
Related issues/PRs Suggest a fix/enhancementreqwest
crate with async/await.pub trait UsersApi { fn users_conversations(&self, params: UsersConversationsParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_delete_photo(&self, params: UsersDeletePhotoParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_get_presence(&self, params: UsersGetPresenceParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_identity(&self, params: UsersIdentityParams) -> Result<serde_json::Value, Error>; fn users_info(&self, params: UsersInfoParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_list(&self, params: UsersListParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_lookup_by_email(&self, params: UsersLookupByEmailParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_profile_get(&self, params: UsersProfileGetParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_profile_set(&self, params: UsersProfileSetParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_set_active(&self, params: UsersSetActiveParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_set_photo(&self, params: UsersSetPhotoParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; fn users_set_presence(&self, params: UsersSetPresenceParams) -> Result<::std::collections::HashMap<String, serde_json::Value>, Error>; }
to:
pub async fn conversations(config: &Configuration, params: UsersConversationsParams) -> Result; pub async fn delete_photo(config: &Configuration, params: UsersDeletePhotoParams) -> Result; pub async fn get_presence(config: &Configuration, params: UsersGetPresenceParams) -> Result; pub async fn identity(config: &Configuration, params: UsersIdentityParams) -> Result; pub async fn info(config: &Configuration, params: UsersInfoParams) -> Result; pub async fn list(config: &Configuration, params: UsersListParams) -> Result; pub async fn lookup_by_email(config: &Configuration, params: UsersLookupByEmailParams) -> Result; pub async fn profile_get(config: &configuration, params: UsersProfileGetParams) -> Result; pub async fn profile_set(config: &Configuration, params: UsersProfileSetParams) -> Result; pub async fn set_active(config: &Configuration, params: UsersSetActiveParams) -> Result; pub async fn set_photo(config: &Configuration, params: UsersSetPhotoParams) -> Result; pub async fn set_presence(config: &Configuration, params: UsersSetPresenceParams) -> Result;
Instead of:
fn users_list(&self, cursor: Option<&str>, token: Option<&str>, limit: Option<i32>, include_locale: Option<bool>)
do:
#[derive(Default)] struct UsersListParams { cursor: Option<&str>, token: Option<&str>, limit: Option<i32>, include_locale: Option<bool>, } fn users_list(&self, params: UsersListParams)
I'm willing to sponsor work on this issue to the tune of $500.
cc @wing328
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4