OpenAPITools / OpenAPITools/openapi-generator

[BUG][Rust server] `Can't find ``client`` example, specify example.path` when running server stub

Open
#9,023 3 comments 0 reactions 1 assignee View on GitHub

@kubajal is already working on this.

Since Apr 8, 2021.

Issue: Bug Server: Rust
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

I'm developing a small project here: https://github.com/kubajal/minimax-in-rust
I cannot run code generated by openapi-generator-cli v5.0.1 through cargo run --example server in Docker image rust:1.50 . I get the following error:

root@67eadc0267a7:/rust-app# cargo run --example server
error: failed to parse manifest at `/rust-app/Cargo.toml`

Caused by:
  can't find `client` example, specify example.path

I'd expect this to succeed as that is the step described in the README.md generated by npx @openapitools/openapi-generator-cli generate -i swagger.yml -g rust-server.

openapi-generator version

v5.0.1
I downloaded it through https://openapi-generator.tech/docs/installation/.

OpenAPI declaration file content or url

https://github.com/kubajal/minimax-in-rust/blob/main/swagger.yml

Generation Details

I just used npx @openapitools/openapi-generator-cli generate -i swagger.yml -g rust-server.

Steps to reproduce
git clone https://github.com/kubajal/minimax-in-rust.git
cd minimax-in-rust
docker build -t rust-app
docker run -it rust-app
# in the container
cd /rust-app
cargo run --example server
Related issues/PRs

None that I found.

Suggest a fix

I have no idea. I am a beginner in Rust.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.