Open beccon4 opened 6 years ago
The part of the code responsible for consume
is obviously behind of what Swagger is requiring now.
There is a line
"swagger" : "2.0",
which should tell the editor to stick to that version. Or is it something else?
Is there a workaround to produce valid code anyway?
There is no workaround I can guess now, but it shouldn't be hard to fix it. I'll try to come up with solution tonight.
So to clarify a bit the only thing to reproduce the bug is to go to https://editor.swagger.io/ and paste the markup Raisin produces, is that correct?
Yes I did so. I also installed the swagger-codegen batch program which produces exact the same result. (it seems to be the same software in both the edior and in the standalone version)
Using the samples at Github I set up a rather simple server:
Which results in the following Swagger-File:
Pasting this into the Swagger editor results in the following error message:
... and the suggested App call:
curl -X POST "http://localhost:5000/foo" -H "accept: application/json" -H "Content-Type: application/json" -d "foo=bar"
which is of course not valid as we'd expect something JSON we could pick up from POST, such ascurl -X POST "http://localhost:5000/foo" -H "accept: application/json" -H "Content-Type: application/json" -d '{"foo":"bar"}'
The code generated with codegen doen't work either as the server expects formData. The documentation suggests parameter settings as I put in my sample.
Using the full code listing from the Github synposis (user management sample) doesn't result in usable code either.
What's wrong here? An issue with the software or with the documentation?