New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-server generated code does not compile #8201
Comments
Thanks for the report. It looks like this is caused by the presence of multiple tags for some endpoints. This seems to cause swagger-codegen (for rust-server, at least) to generate duplicates, which is what you're seeing. The tests for fixing this will be to add the following to the spec: /fake/many_tags:
get:
tags:
- user
- store
description: Multiple status values can be provided with comma separated strings
responses:
'200':
description: foo |
Thanks for this, I attempted to work around it with
which fails, but less so :) I've attached the generated file and the errors https://gist.github.com/jsnewby/8f220d22ea10659b925072b637456ad0 here |
Interesting. Thanks for the report. It looks as if the following is the problem:
Given that we end up with The other problem is simpler - if the API has more than 32 regexes, the generated code will fail to compile. |
Ah OK super interesting, are you able to suggest a workaround for this one? I guess I can slice up the YAML but that seems a bit brutal... |
I can't think of a better workaround. The fix looks pretty simple, though - There's been a slowdown in getting PRs merged, though, so I'm not sure when I'll get to this. |
Description
The code generated from our swagger file fails to compile with multiple errors.
Swagger-codegen version
Tried with current stable release and with recent nightly (swagger-codegen-cli-2.4.0-20180511.013033-251.jar)
Swagger declaration file content or url
https://github.com/aeternity/epoch/blob/master/config/swagger.yaml
Command line used for generation
java -jar ~/Downloads/swagger-codegen-cli-2.4.0-20180511.013033-251.jar generate -i ../aeternity/src/epoch/config/swagger.yaml -l rust-server
Steps to reproduce
java -jar ~/Downloads/swagger-codegen-cli-2.4.0-20180511.013033-251.jar generate -i ../aeternity/src/epoch/config/swagger.yaml -l rust-server
cargo check
fails with multiple errors like
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: