Uh oh!
There was an error while loading. Please reload this page.
[C-libcurl] The JSON key name in request/response body should not be escaped even though it is a C key word. - #4893
Conversation
…escaped even though it is a C key word.
zhemant
commented
Jan 1, 2020
I would like to suggest something, I had faced issue with the struct names, enum values being repeateded or the api contains same struct name but different internal parameters. To overcome this add the complete name i.e. project name to make each variable, function unique. This has helped me to overcome a lot of issue. only problem is the length of variables increases. But it helps in enums(when two enums have same value, we get compile error in c if in same project) also when there are two structs with same name. if (!("object".equals(name))) { This is the logic i have added in toModelName function in .java file. If you need to talk more, you can ping me on gitter. |
wing328
commented
Jan 2, 2020
* master: (275 commits) Initial CODEOWNERS (OpenAPITools#4924) [scala] Support for Set when array has uniqueItems=true (OpenAPITools#4926) remove nodejs server samples, scripts (OpenAPITools#4919) Added ability to work with `defaultHeaders` and fixed authentication for code generated by openapi-generator for typescript-node (OpenAPITools#4896) replace petstore_api with packageName (OpenAPITools#4921) remove base_object_spec.mustache from ruby client (OpenAPITools#4918) Add an link to Ada article (OpenAPITools#4920) avoid using hardcode prefix in example (OpenAPITools#4917) [dart-dio] Fix basepath (OpenAPITools#4911) [java][client] jackson update (OpenAPITools#4907) [Swift] Minor improvements to swift 5 generator (OpenAPITools#4910) [cpp-restbed] Added "out-of-the-box" functionality (OpenAPITools#4759) New generator swift5 (OpenAPITools#4086) [dart-dio] Adds support for multipart form data post body (OpenAPITools#4797) [go][client] fix when schema have multiple servers (OpenAPITools#4901) Unables CI tests of python-flask-python2 (OpenAPITools#4889) [C-libcurl] The JSON key name in request/response body should not be escaped even though it is a C key word. (OpenAPITools#4893) upgrade to JUnit 4.13 (OpenAPITools#4899) [r] Ignoring README.md in Rbuildignore (OpenAPITools#4898) update samples ...
When a struct field in the generated c client is a C key word (e.g. continue), it should be escaped. This is implemented by the PR #4735.
But #4735 introduces an issue, that is the JSON key name in request/response body is also escaped.
e.g.
This will cause logic error when API server processes the request/response body.
Actually the JOSN key name should not be escaped, e.g.
PR checklist
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.3.x,5.0.x. Default:master.@wing328@zhemant