Skip to content
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

Add C client generator #516

Merged
merged 123 commits into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
a692d5a
add c generator (1st commit)
wing328 Jul 9, 2018
18b24d1
udpate c model template
wing328 Jul 9, 2018
085f917
Merge remote-tracking branch 'origin/master' into c_generator
wing328 Aug 8, 2018
21df220
more fixes
wing328 Aug 8, 2018
b9f47cb
Add string replace function for C generator (#908)
zhemant Sep 4, 2018
78d86ba
add uncrustify support
wing328 Sep 4, 2018
b8022b5
Merge remote-tracking branch 'origin/master' into better_c_code_format
wing328 Sep 4, 2018
68c5c11
update petstore sampmles
wing328 Sep 4, 2018
480371d
Merge remote-tracking branch 'origin/master' into c_generator
wing328 Sep 4, 2018
4e3dd42
Merge remote-tracking branch 'origin/c_generator' into better_c_code_…
wing328 Sep 4, 2018
4119a10
add Locale.ROOT
wing328 Sep 4, 2018
b610121
added test-api-client.c to include test cases for strReplace function
zhemant Sep 4, 2018
c8a6c3d
added header and body mustache and made changes to ClibcurlClientCode…
zhemant Sep 4, 2018
63e2139
[C] renamed functions in apiKey.c.mustache according to apiKey.h.must…
zhemant Sep 4, 2018
5eae0ac
[C] changes in import statement
zhemant Sep 4, 2018
45cda5d
Merge remote-tracking branch 'origin/master' into c_generator
wing328 Sep 6, 2018
4291af7
renamed apiKey.h to keyValuePair.h and made necessary changes in the …
zhemant Sep 4, 2018
8ef4dbb
changed apiKey.c according to keyValuePair.h
zhemant Sep 4, 2018
a1d13e7
fixed import statement in model
zhemant Sep 4, 2018
f332434
added code for generating struct in model-header.mustache
zhemant Sep 5, 2018
4568967
added typedef struct for model-headers
zhemant Sep 5, 2018
0835a4d
updated sample/client/petstore/C
zhemant Sep 5, 2018
69272eb
Merge branch 'c_generator' of https://github.com/zhemant/openapi-gene…
wing328 Sep 6, 2018
da5f404
Merge branch 'zhemant-c_generator' into c_generator
wing328 Sep 6, 2018
e84ea25
fix locale
wing328 Sep 6, 2018
86c5e7b
[C] Function addition and modification of major structs (#1020)
zhemant Sep 12, 2018
32ea217
Merge remote-tracking branch 'origin/c_generator' into better_c_code_…
wing328 Sep 12, 2018
29e901b
Merge branch 'better_c_code_format' into c_generator
wing328 Sep 12, 2018
1b1d820
clean up files
wing328 Sep 12, 2018
11256d3
regenerate c petstore
wing328 Sep 12, 2018
5b596d2
fix error message when setting uncrustify
wing328 Sep 12, 2018
d2d5c8a
add version to uncrustify usage
wing328 Sep 12, 2018
692d503
added uncrustify rules in mustache (#1021)
zhemant Sep 12, 2018
f519ded
fix file import, unformat c petstore
wing328 Sep 12, 2018
c595349
fix import in test files
wing328 Sep 12, 2018
1fd318c
fix model with complexType
wing328 Sep 12, 2018
77e3c36
fix free string, format the code using uncrustify
wing328 Sep 12, 2018
ce796a0
modified sample
zhemant Sep 14, 2018
427f5a7
Modified sample to check
zhemant Sep 14, 2018
0c1b16b
return type issue figured,more to do to fix it
zhemant Sep 15, 2018
7becd72
minor fixes to make complete code compile
zhemant Sep 16, 2018
49d05df
Compiling sample code. Store has issue with map.
zhemant Sep 17, 2018
34a95fd
comment out test file generation which is not req.
zhemant Sep 17, 2018
4dd5ac4
commented operation name
zhemant Sep 17, 2018
8f5ba3c
fixed various issues responsible for code not compiling
zhemant Sep 17, 2018
4425d67
test mustache temporary for testing
zhemant Sep 17, 2018
ac2a7d3
updated sample add,del,getbyid works, formparam yet to do
zhemant Sep 19, 2018
df32079
few minor changes and added fuction to add different header and conte…
zhemant Sep 19, 2018
4635f30
added code to upload image
zhemant Sep 20, 2018
c1027a9
added function to test upload image
zhemant Sep 20, 2018
de6f1ec
fixes for fileupload and various other small things
zhemant Sep 20, 2018
d052544
fixed issue due to xml produces
zhemant Sep 20, 2018
9fcd026
updated sample:working sample add,del,find,uploading:tocheck ,
zhemant Sep 20, 2018
0f1d05f
Merge branch 'zhemant-c_generator' into c_generator
wing328 Sep 20, 2018
80a10b6
added free functions for variable where memory is allocated
zhemant Sep 21, 2018
9473340
rename imagecontainer struct to filestruct
zhemant Sep 21, 2018
02377fc
fix issues with if functions for all list types
zhemant Sep 21, 2018
cb35c5a
fixed issue with primitive return type in header file
zhemant Sep 21, 2018
beb5904
updated sample w/ free functions
zhemant Sep 21, 2018
dee85b7
Merge branch 'zhemant-c_generator' into c_generator
wing328 Sep 23, 2018
7d4270e
update c samples
wing328 Sep 23, 2018
9a90c4a
remove corrupted file
wing328 Sep 24, 2018
96b95c9
update samples
wing328 Sep 24, 2018
48f3425
test cases for APIs
zhemant Sep 24, 2018
e0a3fe5
added function to generate test cases from new mustache
zhemant Sep 24, 2018
a9f7c64
mustache files for manual written test cases
zhemant Sep 24, 2018
a83c14f
added default content type to application/json
zhemant Sep 24, 2018
99ba1f5
fixed issue with primitive return type
zhemant Sep 24, 2018
7d9dab0
fixed issue with bool type
zhemant Sep 24, 2018
781897a
added file apiKey.c
zhemant Sep 24, 2018
731e4dd
updated sample tested
zhemant Sep 24, 2018
f39815f
update c environment variable (#1090)
wing328 Sep 25, 2018
01c6696
Merge branch 'c_generator' of https://github.com/zhemant/openapi-gene…
wing328 Sep 25, 2018
970d5a7
Merge branch 'zhemant-c_generator' into c_generator
wing328 Sep 25, 2018
f67f1c9
add mapping for map (#1103)
wing328 Sep 25, 2018
4b2986e
minor update
wing328 Sep 25, 2018
1ad49c2
revert list paramter check to NULL
zhemant Sep 25, 2018
1f1deda
modified return type for primitive(map - list_t)in mustache
zhemant Sep 25, 2018
c0d766d
removed apiClient_free as it was two times
zhemant Sep 25, 2018
3b8ef43
updated sample
zhemant Sep 25, 2018
436438c
fixed issue of path parameter when string less than parameter len
zhemant Sep 25, 2018
bc86de5
fixed issue for form paramters upload
zhemant Sep 26, 2018
b42aa62
added checks to avoid seg faults
zhemant Sep 26, 2018
8e901ee
updated sample
zhemant Sep 26, 2018
5871428
added check for null value in form parameter
zhemant Sep 26, 2018
d76ee54
Merge branch 'zhemant-c_generator' into c_generator
wing328 Sep 26, 2018
3e00feb
modified size of mallocs to dynamic
zhemant Sep 27, 2018
2be912f
updated sample
zhemant Sep 27, 2018
d308570
Merge branch 'zhemant-c_generator' into c_generator
wing328 Sep 29, 2018
f933eee
Add C Petstore to Travis CI (#1136)
wing328 Sep 29, 2018
6ac359f
Merge remote-tracking branch 'origin/master' into c_generator
wing328 Sep 29, 2018
f0faafe
fixed memory leak in strReplace and apiClient Functions
zhemant Sep 28, 2018
79b43c5
modified return value for status generation
zhemant Sep 28, 2018
9940c09
added enum defination and functions to convert and back from string
zhemant Oct 1, 2018
e85ed1a
added function for enum and made changes to free memory at necessary …
zhemant Oct 1, 2018
47041ab
added datatype handling for enum
zhemant Oct 1, 2018
348c63d
fixes regarding memory allocation and free
zhemant Oct 1, 2018
b16d518
updated mustache of test files
zhemant Oct 1, 2018
d9cce8b
updated sample
zhemant Oct 1, 2018
6d5d6bf
renamed manually written test files
zhemant Oct 1, 2018
8f78145
manual test file for pet
zhemant Oct 1, 2018
d9b83d9
cleaned common api test file for time being
zhemant Oct 1, 2018
9313f21
renamed test files
zhemant Oct 1, 2018
f86ce4c
added renamed test files to build test bash
zhemant Oct 1, 2018
c0a5b2f
added file null pointer check
zhemant Oct 1, 2018
0656180
modified uncrusitfy rules
zhemant Oct 3, 2018
6e082b3
Merge branch 'zhemant-c_generator' into c_generator
wing328 Oct 3, 2018
ae341b1
minor update to c templates (#1161)
wing328 Oct 3, 2018
17ecb4f
[C] Fixed enum function declaration (#1178)
zhemant Oct 6, 2018
29ccb3e
disable curl verbose mode and add response code variable
zhemant Oct 9, 2018
d6e652e
added response code variable in apiClient struct
zhemant Oct 9, 2018
7cff463
modified apiClient header and source file
zhemant Oct 9, 2018
6b109dc
added response and removed commented code api-body mustache
zhemant Oct 9, 2018
1245993
removed commented code from model-body mustache
zhemant Oct 9, 2018
40644f2
removed unnecessary print statements from test mustache
zhemant Oct 9, 2018
4edbcd1
updated sample
zhemant Oct 9, 2018
914b0a9
fixed spaces issue
zhemant Oct 10, 2018
fade893
Merge branch 'zhemant-c_generator' into c_generator
wing328 Oct 11, 2018
77a821e
Better format in C templates (#1224)
wing328 Oct 12, 2018
5780968
[C] changed base url from static to dynamic (#1225)
zhemant Oct 12, 2018
8bd7416
[C] added curl version check in CMakeList.txt (#1248)
zhemant Oct 16, 2018
f72b196
[C] Major changes to keyValuePair function (#1282)
zhemant Nov 3, 2018
e2763a9
Skip test file generation (#1459)
wing328 Nov 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions bin/c-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/C-libcurl -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g c -o samples/client/petstore/C $@"

# purge folder
echo "Purge folder samples/client/petstore/C"
rm -Rf samples/client/petstore/C

java $JAVA_OPTS -jar $executable $ags
10 changes: 10 additions & 0 deletions bin/windows/c-petstore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g c -o samples\client\petstore\C

java %JAVA_OPTS% -jar %executable% %ags%
Loading