Qovery / scaleway-api-rs

Rust lib for Scaleway API
GNU General Public License v3.0
9 stars 1 forks source link

add `lb` open API specs #3

Open benjaminch opened 3 years ago

benjaminch commented 3 years ago

Seems lb API specs make openapi generator produce code which leads to rust compilation error.

https://developers.scaleway.com/static/88c7c88370da8e5a3316e5831e230183/scaleway.lb.v1.Api.yml

   Compiling scaleway_api_rs v0.1.0 (/Users/user/Code/scaleway-api-rs)
error[E0428]: the name `ips_api` is defined multiple times
  --> src/apis/mod.rs:78:1
   |
77 | pub mod ips_api;
   | ---------------- previous definition of the module `ips_api` here
78 | pub mod ips_api;
   | ^^^^^^^^^^^^^^^^ `ips_api` redefined here
   |
   = note: `ips_api` must be defined only once in the type namespace of this module

error[E0599]: the method `to_string` exists for enum `std::option::Option<&str>`, but its trait bounds were not satisfied
   --> src/apis/alert_subscribers_api.rs:237:74
    |
237 |     local_var_req_builder = local_var_req_builder.query(&[("name", &name.to_string())]);
    |                                                                          ^^^^^^^^^ method cannot be called on `std::option::Option<&str>` due to unsatisfied trait bounds
    |
   ::: /Users/user/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:161:1
    |
161 | pub enum Option<T> {
    | ------------------
    | |
    | doesn't satisfy `std::option::Option<&str>: ToString`
    | doesn't satisfy `std::option::Option<&str>: std::fmt::Display`
    |
    = note: the following trait bounds were not satisfied:
            `std::option::Option<&str>: std::fmt::Display`
            which is required by `std::option::Option<&str>: ToString`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0428, E0599.
For more information about an error, try `rustc --explain E0428`.
error: could not compile `scaleway_api_rs`

To learn more, run the command again with --verbose.
benjaminch commented 3 years ago

Seems to still have an issue with latest version:

 spectral lint https://developers.scaleway.com/static/ce3d3fd4ca65dc13786b22e6ecd3ebea/scaleway.lb.v1.Api.yml

https://developers.scaleway.com/static/ce3d3fd4ca65dc13786b22e6ecd3ebea/scaleway.lb.v1.Api.yml
   2:6    warning  info-contact           Info object must have "contact" object.                        info
  294:27    error  no-$ref-siblings       $ref must not be placed next to any other properties           components.schemas.scaleway.lb.v1.Acl.properties.frontend.properties.certificate.deprecated
  601:23    error  no-$ref-siblings       $ref must not be placed next to any other properties           components.schemas.scaleway.lb.v1.Frontend.properties.certificate.deprecated
  1299:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/acls/{acl_id}.get
  1332:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/acls/{acl_id}.put
 1446:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/acls/{acl_id}.delete
  1476:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}.get
  1509:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}.put
 1588:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}.delete
  1618:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}/healthcheck.put
 1754:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}/servers.post
  1803:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}/servers.put
 1852:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/backends/{backend_id}/servers.delete
  1902:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/certificates/{certificate_id}.get
  1935:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/certificates/{certificate_id}.put
 1982:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/certificates/{certificate_id}.delete
  2012:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/frontends/{frontend_id}.get
  2045:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/frontends/{frontend_id}.put
 2120:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/frontends/{frontend_id}.delete
  2150:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/frontends/{frontend_id}/acls.get
 2217:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/frontends/{frontend_id}/acls.post
  2336:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/ips.get
 2398:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/ips.post
  2449:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/ips/{ip_id}.get
 2482:11  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/ips/{ip_id}.patch
 2528:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/ips/{ip_id}.delete
  2558:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lb-types.get
 2600:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lb/{lb_id}/subscribe.post
 2648:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lb/{lb_id}/unsubscribe.delete
 2682:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lb/subscriber/{subscriber_id}.delete
  2712:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs.get
 2777:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs.post
  2864:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}.get
  2897:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}.put
 2969:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}.delete
  3005:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/backend-stats.get
  3005:9  warning  operation-tags         Operation must have non-empty "tags" array.                    paths./lb/v1/regions/{region}/lbs/{lb_id}/backend-stats.get
  3050:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/backends.get
 3117:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/backends.post
  3349:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/certificates.get
  3503:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/frontends.get
 3570:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/frontends.post
 3647:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/migrate.post
  3695:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/private-networks.get
 3745:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/private-networks/{private_network_id}/attach.post
 3812:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/private-networks/{private_network_id}/detach.post
  3851:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/lbs/{lb_id}/stats.get
  3886:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/routes.get
 3934:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/routes.post
  3990:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/routes/{route_id}.get
  4023:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/routes/{route_id}.put
 4081:12  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/routes/{route_id}.delete
  4111:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/subscribers.get
 4186:10  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/subscribers.post
  4265:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/subscribers/{subscriber_id}.get
  4298:9  warning  operation-description  Operation "description" must be present and non-empty string.  paths./lb/v1/regions/{region}/subscribers/{subscriber_id}.put

✖ 56 problems (2 errors, 54 warnings, 0 infos, 0 hints)