@@ -8,28 +8,22 @@ If you find this project useful, please kindly consider supporting this project
88
99## Quickstart
1010
11- To use the Bazel bindings provided by this repo within a Bazel workspace,
12- you must do the following steps:
11+ As of v0.1.8, this only supports [ Bazel Modules] ( https://bazel.build/external/module ) . The setup is much simpler.
1312
14- 1 . Add the following code to your WORKSPACE file at the root of your repository
13+ 1 . Add the following code to your ` MODULE.bazel ` file at the root of your repository
1514
16- ```
17- load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
18-
19- http_archive(
20- name = "openapi_tools_generator_bazel",
21- sha256 = "ada94694b10f2503c52a48427bd8589323bff5910bd1a7e5212ce34702d0af65",
22- urls = ["https://github.com/OpenAPITools/openapi-generator-bazel/releases/download/v0.1.7/openapi-tools-generator-bazel-0.1.7.tar.gz"],
23- )
24-
25- load("@openapi_tools_generator_bazel//:defs.bzl", "openapi_tools_generator_bazel_repositories")
15+ ```
16+ bazel_dep(name = "openapi_tools_generator_bazel", version = "0.1.8")
17+ openapi_gen = use_extension("@openapi_tools_generator_bazel//:extension.bzl", "openapi_gen")
18+ openapi_gen.client(
19+ sha256 = "f18d771e98f2c5bb169d1d1961de4f94866d2901abc1e16177dd7e9299834721",
20+ version = "6.5.0",
21+ )
22+ use_repo(openapi_gen, "openapi_tools_generator_bazel_cli")
2623
27- # You can provide any version of the CLI that has been uploaded to Maven
28- openapi_tools_generator_bazel_repositories(
29- openapi_generator_cli_version = "5.1.0",
30- sha256 = "62f9842f0fcd91e4afeafc33f19a7af41f2927c7472c601310cedfc72ff1bb19"
31- )
32- ```
24+ # Or, to use the default client (currently 7.2.0), remove the parameters to client().
25+ openapi_gen.client()
26+ ```
3327
34282 . Create a BUILD.bazel file next to the .yaml file you wish to generate code from.
3529 The below example generates a go library within a generated directory named ` petstore_go `
0 commit comments