-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix swagger-codegen cpprest generator. #756
Comments
Relates to #748 I have a commit that fixes a POST request with an optional bodyParam (which doesn't make much sense). By running codegen without that commit, you will be able to identify all POST endpoints with optional payloads. |
I don't see us 'fixing' the first two bullet points whats the difference between a 'raw array' and a 'json item'? sounds like a cpp codegen issue |
So for example,
The schema would likely contain an object with a float inside. I'm not an expert with the swagger api myself, but I believe it is the norm to encapsulate variables in an object. That way you can use reflection on a variable name and/or have "context". Feel free to close this if you disagree. |
yeah, there's nothing in swagger that enforces the convention of always returning an object. there are several endpoints that return a list of integers, list of strings, same with accepting (and yeah, even some that return just an integer or float) the point of swagger is to have an authoritative source to tell what types you can expect with each response code, so I don't see the point in forcing a convention that might not work in every context (or adding unnecessary overhead). If it was invalid JSON I could see your point, but as is I'm of the opinion this is a codegen issue. |
Bug
Using swagger-codegen, try and generate a cpprest project. Once this issue is fixed, add cpprest generation to your unit tests.
Request
I started fixing the cpprest generator for codegen, but it is clear that ESI has unexpected endpoints which break codegen.
Here are some (general) issues. You can reproduce them (and more) by running codgen master branch (2.4.0) with the cpprest template.
I started a PR to codegen. It might help you when you try and generate a project and the build fails.
swagger-api/swagger-codegen#7571
Response
Many build errors, some are codegen issues.
Expected
Swagger-codegen generates cpprest project and it builds. Whether it runs without errors is another issue for another day, lets get it compiling first :)
The text was updated successfully, but these errors were encountered: