-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Several clients break due to model 'break' #3846
Comments
@karussell thanks for reporting the issue. Would you have time to apply the same fix to Sinatra and Dart generator: Lines 393 to 397 in 569997b
|
Sorry, lack of time and skills in this language area :/ |
Fixed via #4023. Please pull the latest master to give it a try. |
Thanks a lot! For dart it works but for sinatra I get an exception although it says 'renamed to ModelBreak': java -jar swagger-codegen-cli-master.jar generate -i https://graphhopper.com/api/1/vrp/swagger.json -l sinatra -o ./sinatra
[main] INFO io.swagger.parser.Swagger20Parser - reading from https://graphhopper.com/api/1/vrp/swagger.json
[main] WARN io.swagger.codegen.languages.SinatraServerCodegen - Break (reserved word) cannot be used as model filename. Renamed to ModelBreak
Exception in thread "main" java.lang.RuntimeException: Could not process model 'Break'.Please make sure that your schema is correct!
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:298)
at io.swagger.codegen.cmd.Generate.run(Generate.java:223)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:41)
Caused by: java.lang.RuntimeException: Break (reserved word) cannot be used as a model name
at io.swagger.codegen.languages.SinatraServerCodegen.toModelFilename(SinatraServerCodegen.java:198)
at io.swagger.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:1214)
at io.swagger.codegen.DefaultGenerator.processModels(DefaultGenerator.java:887)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:291)
... 2 more |
@karussell sorry I forgot to commit the remaining change. #4024 should fix it (will merge it after passing the CI tests) |
#4024 merged into master. Please kindly give it another try. Sorry for the inconvenience caused. |
I highly appreciate your work&time! (btw: no need to sorry :)!) |
Description
For two clients Sinatra&Dart I get a problem that model 'break' is not allowed, but e.g. Java, .Net or Python just renames break to ModelBreak. E.g.
Swagger-codegen version
swagger-codegen-cli-2.2.1.jar
Swagger declaration file content or url
https://graphhopper.com/api/1/vrp/swagger.json
Command line used for generation
https://github.com/graphhopper/directions-api-clients-route-optimization/blob/master/create.sh
Steps to reproduce
git clone https://github.com/graphhopper/directions-api-clients-route-optimization cd directions-api-clients-route-optimization ./create.sh
The text was updated successfully, but these errors were encountered: