Skip to content

Commit c85ac72

Browse files
authored
Use released openapi generator (opensearch-project#364)
* change to released openapi generator Signed-off-by: xil <fridalu66@gmail.com> * Add gitignore Signed-off-by: xil <fridalu66@gmail.com> --------- Signed-off-by: xil <fridalu66@gmail.com> Signed-off-by: Xi Lu <fridalu66@gmail.com>
1 parent 76d0cf1 commit c85ac72

5 files changed

Lines changed: 16 additions & 22 deletions

File tree

.github/workflows/backward-compatible-report.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,12 @@ jobs:
102102
OPENSEARCH_VERSION: ${{ steps.get_opensearch_version.outputs.version }}
103103
run: npm ci && npm run preprocessing -- --opensearch-version "$OPENSEARCH_VERSION"
104104

105-
- name: Download openapi-generator JAR
106-
run: |
107-
curl -L -f -o openapi-generator-cli.jar \
108-
https://github.com/opensearch-project/opensearch-protobufs/releases/download/openapi-generator-tool/openapi-generator-cli.jar
109-
110105
- name: Convert protobuf
106+
env:
107+
OPENAPI_GENERATOR_VERSION: 7.19.0
111108
run: |
112-
java -jar openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
109+
npx --yes @openapitools/openapi-generator-cli generate \
110+
-c tools/proto-convert/src/config/protobuf-generator-config.yaml
113111
114112
- name: Check for auto-pr-branch and use its protos if exists
115113
run: |

.github/workflows/convert-proto.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,12 @@ jobs:
104104
OPENSEARCH_VERSION: ${{ steps.get_opensearch_version.outputs.version }}
105105
run: npm ci && npm run preprocessing -- --opensearch-version "$OPENSEARCH_VERSION"
106106

107-
- name: Download openapi-generator JAR
108-
run: |
109-
curl -L -f -o openapi-generator-cli.jar \
110-
https://github.com/opensearch-project/opensearch-protobufs/releases/download/openapi-generator-tool/openapi-generator-cli.jar
111-
112107
- name: Convert protobuf
108+
env:
109+
OPENAPI_GENERATOR_VERSION: 7.19.0
113110
run: |
114-
java -jar openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
111+
npx --yes @openapitools/openapi-generator-cli generate \
112+
-c tools/proto-convert/src/config/protobuf-generator-config.yaml
115113
116114
- name: Post Process Protobuf
117115
id: merge_report

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ Thumbs.db
7070
protos/generated
7171
/cloned-repo
7272
opensearch-openapi.yaml
73+
openapitools.json

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
### Added
77
- Add local Protobuf conversion instructions to README ([#362](https://github.com/opensearch-project/opensearch-protobufs/pull/362))
88
- Add in-place rename support for oneOf fields in post-processing ([#363](https://github.com/opensearch-project/opensearch-protobufs/pull/363))
9+
- Use official openapi-generator tool ([#364](https://github.com/opensearch-project/opensearch-protobufs/pull/364))
10+
911
### Changed
1012

1113
### Removed

DEVELOPER_GUIDE.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,15 @@ To generate Protobuf definitions from the latest OpenSearch API specification, f
124124
npm ci && npm run preprocessing
125125
```
126126

127-
3. **Download OpenAPI Generator CLI**
127+
3. **Generate Protobuf**
128128

129129
```bash
130-
curl -L -f -o openapi-generator-cli.jar \
131-
https://github.com/opensearch-project/opensearch-protobufs/releases/download/openapi-generator-tool/openapi-generator-cli.jar
130+
export OPENAPI_GENERATOR_VERSION=7.19.0
131+
npx @openapitools/openapi-generator-cli generate \
132+
-c tools/proto-convert/src/config/protobuf-generator-config.yaml
132133
```
133134

134-
4. **Convert to Protobuf**
135-
136-
```bash
137-
java -jar openapi-generator-cli.jar generate -c tools/proto-convert/src/config/protobuf-generator-config.yaml
138-
```
139-
140-
5. **Run Postprocessing**
135+
4. **Run Postprocessing**
141136

142137
```bash
143138
npm run postprocessing

0 commit comments

Comments
 (0)