Skip to content

[BUG] RustServer can't find crate tokio #5887

@paladinzh

Description

@paladinzh

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

error[E0463]: can't find crate for tokio
--> output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs:45:1
|
45 | extern crate tokio;
| ^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try rustc --explain E0463.
error: could not compile petstore-with-fake-endpoints-models-for-testing.
warning: build failed, waiting for other jobs to finish...
error: build failed

openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix

+++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache
@@ -87,7 +87,7 @@ mime_multipart = {version = "0.5", optional = true}
hyper_0_10 = {package = "hyper", version = "0.10", default-features = false, optional=true}
{{/apiUsesMultipartRelated}}
serde_ignored = {version = "0.0.4", optional = true}
-tokio = {version = "0.1.17", optional = true}
+tokio = {version = "0.1.17", optional = false}
url = {version = "1.5", optional = true}

Client-specific

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions