-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroduce instructions to generate client
- Loading branch information
1 parent
0d67199
commit 4a17e8b
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generating a new client | ||
|
||
Every time | ||
|
||
|
||
1. Create a new branch `git checkout -b new_branch_name` | ||
2. Install openapi-generator | ||
|
||
```npm install @openapitools/openapi-generator-cli -g``` | ||
|
||
2. Place the latest swagger.json in `./generate/swagger.json` | ||
|
||
3. Remove the current files except the `token.py` file | ||
|
||
``` | ||
mv data_bridges_client/token.py . | ||
rm -rf tests docs data_bridges_client | ||
mkdir data_bridges_client | ||
mv ./token.py data_bridges_client/ | ||
``` | ||
|
||
5. Generate the client by running this command from the root of the repository. We pin the version to 5.4.0 as python templates from more recent versions don't seem to work. | ||
``` | ||
openapi-generator-cli version-manager set 5.4.0 | ||
openapi-generator-cli generate -g python -i generate/swagger.json -o . --package-name data_bridges_client --git-user-id WFP-VAM --git-repo-id DataBridgesAPI | ||
``` | ||
4. Manually revert changes to `setup.py` and `README.md`. These relate to additional functionality we developed to handle the WFP token refresh workflow. | ||
5. Commit, push and open a PR into `dev` for review. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
openapi-generator-cli version-manager set 5.4.0 | ||
openapi-generator-cli generate -g python -i generate/swagger.json -o . --package-name data_bridges_client --git-user-id WFP-VAM --git-repo-id DataBridgesAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm install @openapitools/openapi-generator-cli -g |