Open Oleg-Stepanenko-owo opened 4 years ago
4.3.1-SNAPSHOT - same issue
what about:
/*
* object.h
*/
typedef struct object_t {
cJSON *temporary;
} object_t;
void object_free(object_t *object) {
if (object) {
cJSON_Delete(object->temporary);
}
free (object);
}
cJSON *object_convertToJSON(object_t *object) {
if(object){
object->temporary = cJSON_CreateObject();
return object->temporary;
}
}
Hello, but object_convertToJSON function look same like before. not sure that:
cJSON *object_convertToJSON(object_t *object) {
cJSON *item = cJSON_CreateObject();
return item;
fail:
cJSON_Delete(item);
return NULL;
}
object_t *object_parseFromJSON(char *jsonString){
object_t *object = NULL;
return object;
end:
return NULL;
}
is logical correct. ???
Bug Report Checklist
Description
I use OpenApi3 generator (Openapi-generator-cli-4.1.0) for C client, and found not for clean functional for me.
So, I have some json template where I plan to use "payload" like addition parameter (json Object type) for my functionality:
after generation we have object.h and object.c files for working with object_t type.
Please to correct my if I am wrong. For make "object" type need to do something like:
but currently looks like that function:"object_convertToJSON" not fully correct or maybe my json template wrong?
I fix this issue internally, like:
openapi-generator version
Openapi-generator-cli-4.1.0
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix