Skip to content

Commit 168ab55

Browse files
authored
Merge pull request #1 from dkliban/openapi-generator
Switches to using openapi-generator
2 parents cacaab8 + 0a73e80 commit 168ab55

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed
File renamed without changes.

README.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
pulp-swagger-codegen
2-
====================
1+
pulp-openapi-generator
2+
======================
33

44
This repository provides a script that helps generate Python and Ruby bindings for pulpcore or any of it's
55
plugins.
66

7-
The first time the script is run, a docker container with swagger-codegen-cli is downloaded. All
7+
The first time the script is run, a docker container with openapi-generator-cli is downloaded. All
88
subsequent runs will re-use the container that was downloaded on the initial run.
99

1010
Requirements

generate.sh

+10-13
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,29 @@ fi
1616

1717
if [ $2 = 'python' ]
1818
then
19-
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
19+
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
2020
-i /local/api.json \
21-
-l python \
21+
-g python \
2222
-o /local/$1-client \
2323
-DpackageName=pulpcore.client.$1 \
2424
-DprojectName=$1-client \
25-
-DpackageVersion=${VERSION}
25+
-DpackageVersion=${VERSION} \
26+
--skip-validate-spec \
27+
--strict-spec=false
2628
cp python/__init__.py $1-client/pulpcore/
2729
cp python/__init__.py $1-client/pulpcore/client
28-
# There is a bug in swagger-codegen. When using package names within a namespace it creates the package
29-
# accross 2 different directories. We move everything back into place here.
30-
cp $1-client/pulpcore.client.$1/* $1-client/pulpcore/client/$1/
31-
cp $1-client/pulpcore.client.$1/api/* $1-client/pulpcore/client/$1/api/
32-
cp $1-client/pulpcore.client.$1/models/* $1-client/pulpcore/client/$1/models/
33-
# Then remove the wrong directory
34-
rm -rf $1-client/pulpcore.client.$1
3530
fi
3631
if [ $2 = 'ruby' ]
3732
then
38-
docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \
33+
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
3934
-i /local/api.json \
40-
-l ruby \
35+
-g ruby \
4136
-o /local/$1-client \
4237
-DgemName=$1_client \
4338
-DgemLicense="GPLv2" \
44-
-DgemVersion=${VERSION}
39+
-DgemVersion=${VERSION} \
40+
--skip-validate-spec \
41+
--strict-spec=false
4542
fi
4643

4744
rm api.json

0 commit comments

Comments
 (0)