forked from loafle/openapi-generator-original
5 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
|
b0b46d57e0
|
Support for additionalProperties in the C generator "Client: C" solves #5395 (#5440)
* Support for additionalProperties in the C generator. * Support for additionalProperties in the C generator. |
||
|
96c1bda608 |
C additional properties fix #4289 (#4349)
* Correction to C support for additional_properties * TAB to SPACE in one file |
||
|
3be4902444 |
[C] C generator refactored (#2463)
* New modified model header and body mustache for c client generator * remove uncrustify from cmake as it is used during code generation, also remove valgrind as it is not used * add function to encode and decode binary data * update model mustache * update api body and header mustache for handling all types of parameters * update model mustache with variable names and address few more issues to generate working codes * updated api body and header mustaches with support for various new parameters and fix some issues as per new changes in code flow structure * update apiClient header and body mustache as per new modifications for handling binary data and few more stuff * updated samples generated by new modified mustache * update handling of file and binary data type to binary_t * update samples with recent commit on master regarding c-generator * update cmakelist which was ignored by .openapi-generator-ignore, cleanup external folder * update CMakeList mustache to show how to use compiled libary to compile source files * update samples with new cmake * Add comments explaining what each command is doing inshort * remove freeing of base path as it is not memory allocated * update samples to free apiclient object when the requirement is over * add missing cJSON delete to fix memory not freed bugs * use uncrustify to beautify manual written test code |
||
|
edc05df774
|
Add C client generator (#516)
* add c generator (1st commit) * udpate c model template * more fixes * Add string replace function for C generator (#908) * Add string replace function for C generator * Fixed replacement for variable only * Fixed problem for different datatypes of paramName * store return value of modified path * set str_replace variable to be same as original variable. * [C] Fixed coding style issues * add uncrustify support * update petstore sampmles * add Locale.ROOT * added test-api-client.c to include test cases for strReplace function * added header and body mustache and made changes to ClibcurlClientCodegen.java accordingly * [C] renamed functions in apiKey.c.mustache according to apiKey.h.mustache * [C] changes in import statement * renamed apiKey.h to keyValuePair.h and made necessary changes in the codes * changed apiKey.c according to keyValuePair.h * fixed import statement in model * added code for generating struct in model-header.mustache * added typedef struct for model-headers * updated sample/client/petstore/C * fix locale * [C] Function addition and modification of major structs (#1020) * added readme file * fixed parameters in api headers functions * made changes to add readme file and typemapping of array to list * fixed header import statement in apiheader files * modified struct of model type in model header * updated sample * modified README file * updated sample * parse from json function added * modified struct and create function * added include for model * modified parsefromjson function * modified struct and create function for more datatypes * added mapping for date-time and modified model import return statement * modified function parameters * modified include statement * fix function in api body * updated sample * clean up files * regenerate c petstore * fix error message when setting uncrustify * add version to uncrustify usage * added uncrustify rules in mustache (#1021) * added uncrustify rules in mustache * updated sample * updated same with crustify * updated sample with uncrusitfy 0.67 * modified readme about uncrustify requirements * fixed mistakes in readme mustache and sample readme * fix file import, unformat c petstore * fix import in test files * fix model with complexType * fix free string, format the code using uncrustify * modified sample * Modified sample to check * return type issue figured,more to do to fix it * minor fixes to make complete code compile * Compiling sample code. Store has issue with map. * comment out test file generation which is not req. * commented operation name * fixed various issues responsible for code not compiling * test mustache temporary for testing * updated sample add,del,getbyid works, formparam yet to do * few minor changes and added fuction to add different header and content type in apiClient * added code to upload image * added function to test upload image * fixes for fileupload and various other small things * fixed issue due to xml produces * updated sample:working sample add,del,find,uploading:tocheck , * added free functions for variable where memory is allocated * rename imagecontainer struct to filestruct * fix issues with if functions for all list types * fixed issue with primitive return type in header file * updated sample w/ free functions * update c samples * remove corrupted file * update samples * test cases for APIs * added function to generate test cases from new mustache * mustache files for manual written test cases * added default content type to application/json * fixed issue with primitive return type * fixed issue with bool type * added file apiKey.c * updated sample tested * update c environment variable (#1090) * add mapping for map (#1103) * minor update * revert list paramter check to NULL * modified return type for primitive(map - list_t)in mustache * removed apiClient_free as it was two times * updated sample * fixed issue of path parameter when string less than parameter len * fixed issue for form paramters upload * added checks to avoid seg faults * updated sample * added check for null value in form parameter * modified size of mallocs to dynamic * updated sample * Add C Petstore to Travis CI (#1136) * setup CI for C petstore * update bash script permission * unit petapi test * fixed memory leak in strReplace and apiClient Functions * modified return value for status generation * added enum defination and functions to convert and back from string * added function for enum and made changes to free memory at necessary places * added datatype handling for enum * fixes regarding memory allocation and free * updated mustache of test files * updated sample * renamed manually written test files * manual test file for pet * cleaned common api test file for time being * renamed test files * added renamed test files to build test bash * added file null pointer check * modified uncrusitfy rules * minor update to c templates (#1161) * [C] Fixed enum function declaration (#1178) * fixed enum function declaration in model headers * fixed enum declaration in header files for sample * disable curl verbose mode and add response code variable * added response code variable in apiClient struct * modified apiClient header and source file * added response and removed commented code api-body mustache * removed commented code from model-body mustache * removed unnecessary print statements from test mustache * updated sample * fixed spaces issue * Better format in C templates (#1224) * better format in the c template * minor format fix * [C] changed base url from static to dynamic (#1225) * changed basePath from static to dynamic * removed unnecessary header declaration * updated sample * [C] added curl version check in CMakeList.txt (#1248) * added curl version check in CMakeList.txt * Updated README for latest curl version * [C] Major changes to keyValuePair function (#1282) * removed static declaration * changed static declaration * added difference for string and non string * added more code for different function for string and non string * fix issue with param name * change value in keyPairValue to void * fixed issue of difference in function name cases * added support for non char parameters in api * fix issue of map return data * modified manual-StoreAPI map return data handling * fix minor mistake * added support for map and changed code to support value of keyvaluepair as char and other * updated sample * fixed api header declarations * change map declaration in header * resolved issues realted to map data handling * fix minor issues * add N at start if enum variable starts with number * override toParamName method * changed paramters to paramName from baseName * change variables in apibody from baseName to paramName * Skip test file generation (#1459) * skip test file generation * skip overwriting CMakeLists.txt |
||
|
80cf1324c5 |
C Generator Sample - Improvements (#558)
* Added a .gitignore to ignore the build folder * Added a CMakeLists and a basic implementation of a double linked list * Added the pet model * changed the behaviour when a list gets freed - the data of each element doesn't get freed anymore * Added the tool uncrustify in order to make code look better * Uncrustified code * added an implementation(constructor and deconstructor) for the category model * Added a third party JSON library * The pet struct now uses pointers for its members; the pet struct now has a proper constructor and a basic toJSON method * The pet model now gets fully serialized into JSON * Fixed the example url... * Added third party library libcurl * Modified category struct and added an unit test * Added a foreach macro and added two functions * Added a tag model and an unit test * the pet struct now uses no double pointer for it's name anymore and no pointer for the enum status anymore; the pet struct can now be fully converted to json and parsed from json * Added the struct APIClient and an unit test * Uncrustified the unit test for category * Added ifdef in pet.h to prevent errors * Added one API endpoint to get a pet by id * Added a "== 0" comparison that I forgot * Added some kind of debug functionality to test-petApi.c * Removed the DEBUG define * Moved the c petstore example from samples/client/c to samples/client/petstore/c * Renamed function getPetById to petApi_getPetById to avoid name collisions * Removed unecessary method in list.c * Added POST functionality; added petApi_addPet method and improved unit-test for petApi; cleaned up some code in apiClient * removed two methods in list.c(string/tag to JSON) and moved their code directly in the pet_convertToJSON method * Removed old, already commented out, puts artifact in apiClient.c * Added a convertToJSON method to the category model * Added a convertToJSON method to the tag model * changed how the convertToJSON method works in the pet model * Adjusted the unit-tests on how the convertToJSON method now works(now returns a cJSON* instead of a char*) * apiClient_t now needs to be given to API methods as a parameter. This means apiClient_t can now be reused in multiple methods. * Added an untested concept for how authentication could be handled * Tested basicAuth using wireshark and added untested OAuth2 feature * Added support for api key authentication using the http-header and tested functionality using wireshark * Renamed the dataToPost parameter in apiClient_invoke to bodyParameters * Renamed apiKey_t to keyValuePair_t and implemented GET queries * Spaces are now being replaced with + in querryParameters * Renamed assembleHeader to assembleAPIKeyAuthentication and added support to change the request type * Implemented the option to provide custom httpHeader fields to apiClient_invoke * Added support for form parameters to the apiClient_invoke method * update petstore sample |