You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add local Protobuf conversion instructions to README
Signed-off-by: xil <fridalu66@gmail.com>
* update changelog
Signed-off-by: xil <fridalu66@gmail.com>
* rephrase
Signed-off-by: xil <fridalu66@gmail.com>
* update
Signed-off-by: xil <fridalu66@gmail.com>
* Add Prerequisites
Signed-off-by: xil <fridalu66@gmail.com>
---------
Signed-off-by: xil <fridalu66@gmail.com>
**ProtoConvertProcess** consists of the following steps:
89
-
-**Preprocessing** Preprocess downloaded [OpenSearch API Specification](https://github.com/opensearch-project/opensearch-api-specification) before convert to Protobuf-schema.
90
-
-**Conversion** The prepared API specification is transformed into a Protobuf schema using [openapi-generator](https://github.com/OpenAPITools/openapi-generator).
91
-
-**Postprocessing** The resulting Protobuf files are refined and adjusted to meet the standards after the conversion.
106
+
To generate Protobuf definitions from the latest OpenSearch API specification, follow these steps. All commands are intended to be run from the project root directory.
92
107
93
-
The [Spec Preprocessing](tools/proto-convert/src/PreProcessing.ts) includes two steps:
108
+
## Prerequisites
94
109
95
-
1.**Filter**
96
-
- Filters only the target APIs defined in [spec-filter.yaml](tools/proto-convert/src/config/spec-filter.yaml).
97
-
- Extract a single API per group from the OpenSearch spec.
110
+
-**Node.js** >= v22
111
+
-**Java** >= 17
98
112
99
-
2.**Sanitizer**
100
-
- Normalizes schema and property names to be compatible with Protobuf naming rules.
113
+
1.**Download the latest OpenSearch API Specification**
After these steps, you will find the generated Protobuf service definitions in the `generated/services/default_service.proto`. Note that service files need be manually created. You can use `generated/services/default_service.proto` as a reference for defining gRPC service definitions.
147
+
148
+
### Additional Notes
149
+
150
+
-**For Search/Bulk Requests:**
151
+
Protobufs for search and bulk operations are already provided in the repository. Some schemas are excluded from generation because they don't have gRPC supported. The exclusion list is defined in [`spec-filter.yaml`](tools/proto-convert/src/config/spec-filter.yaml) under the `excluded_schemas` section.
152
+
153
+
-**For Other Requests:**
154
+
For other APIs, generate Protobuf definitions locally and review them to ensure they meet your requirements. We recommend implementing and testing a gRPC server with the generated Protobufs to verify correctness. Once validated, submit a Pull Request to add the new API path to [`spec-filter.yaml`](tools/proto-convert/src/config/spec-filter.yaml). A maintainer will merge the PR and run the workflow to automatically generate and incorporate the Protobufs.
155
+
156
+
**Note:** Make sure you are running all commands from the project root folder.
119
157
120
-
**openapi-generator**
121
158
122
-
OpenAPI Generator offers a range of configuration options. The configuration is specified in the [protobuf-generator-config.yaml](tools/proto-convert/src/config/protobuf-generator-config.yaml).
123
-
OpenAPI Generator supports the customization of mustache templates to generate the desired output, with the templates located in [protobuf-schema-template](tools/proto-convert/src/config/protobuf-schema-template)
124
159
# Ignored files
125
160
126
161
All generated files are excluded from version control via the `.gitignore` file. This includes:
0 commit comments