Open piersfinlayson opened 5 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
wrong variable used to log parameter
This is fixed by https://github.com/OpenAPITools/openapi-generator/pull/5490 - the variable's correct, but we should be providing a type that does implement Display so we can provide some detail on why the arg failed to parse.
extraneous use swagger::auth::Authorization;
This is fixed by https://github.com/OpenAPITools/openapi-generator/pull/2504 - specifically https://github.com/OpenAPITools/openapi-generator/pull/2504/files#diff-222a21abd6957cc26b6f8b495c327837R16-R18
models::models::models::TYPE
used instead ofmodels::TYPE
, e.g.
This was fixed by some general tidy up in https://github.com/OpenAPITools/openapi-generator/pull/2504
invalid FromStr implementation e.g.
This is being caused by the clashing Ok
model.
https://github.com/OpenAPITools/openapi-generator/pull/5557 makes some progress to fix this sort of error, but didn't consider those types imported by the prelude such as Result.
I'll add something to that MR to fix this as well.
Description
I have written a simple, sample API, and rust-server generates code which doesn't compile.
Full cargo build output here, but there are three problems:
models::models::models::TYPE used instead of models::TYPE, e.g.
wrong variable used to log parameter e.g.
In this case
, e)
should be, param_arg)
invalid FromStr implementation e.g.
This might be a little harsh! The problem is that
Ok
here ismodels::Ok
notResult::Ok
.Commit fixing the compilation errors here.
There are also similar errors with the client and server examples, plus also an extraneous
use swagger::auth::Authorization;
causing the server example to fail to compile:Fixes for the client and server examples are in this commit.
openapi-generator version
4.0.0-SNAPSHOT
Using container openapitools/openapi-generator-cli:latest
OpenAPI declaration file content or url
openapi.yaml
Command line used for generation
Steps to reproduce
Related issues/PRs
None that I can see
Suggest a fix
See above