File tree 3 files changed +13
-16
lines changed
3 files changed +13
-16
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1
- pulp-swagger-codegen
2
- ====================
1
+ pulp-openapi-generator
2
+ ======================
3
3
4
4
This repository provides a script that helps generate Python and Ruby bindings for pulpcore or any of it's
5
5
plugins.
6
6
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
8
8
subsequent runs will re-use the container that was downloaded on the initial run.
9
9
10
10
Requirements
Original file line number Diff line number Diff line change 16
16
17
17
if [ $2 = ' python' ]
18
18
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 \
20
20
-i /local/api.json \
21
- -l python \
21
+ -g python \
22
22
-o /local/$1 -client \
23
23
-DpackageName=pulpcore.client.$1 \
24
24
-DprojectName=$1 -client \
25
- -DpackageVersion=${VERSION}
25
+ -DpackageVersion=${VERSION} \
26
+ --skip-validate-spec \
27
+ --strict-spec=false
26
28
cp python/__init__.py $1 -client/pulpcore/
27
29
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
35
30
fi
36
31
if [ $2 = ' ruby' ]
37
32
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 \
39
34
-i /local/api.json \
40
- -l ruby \
35
+ -g ruby \
41
36
-o /local/$1 -client \
42
37
-DgemName=$1 _client \
43
38
-DgemLicense=" GPLv2" \
44
- -DgemVersion=${VERSION}
39
+ -DgemVersion=${VERSION} \
40
+ --skip-validate-spec \
41
+ --strict-spec=false
45
42
fi
46
43
47
44
rm api.json
You can’t perform that action at this time.
0 commit comments