- Install homebrew if you haven't already
- Install
brew install just
. just is a command line tool used to run commands defined inside the projectjustfile
. You run commands by passing the command name, for examplejust build-openapi
.
This repository relies on a git submodule to get access to our openapi spec. To clone the repository, use the command:
git clone --recurse-submodules [email protected]:pinecone-io/pinecone-rust-client.git
Or, if you have already cloned the repository, you can update the submodules with
git submodule update --init --recursive
The generated code is already checked into the repository and normally should not need to be modified.
To regenerate OpenAPI or Protobuf code, you will require access to the private apis
repository.
- Follow setup instructions for the
apis
repository: apis setup
OpenAPI
- You need Docker Desktop in order to generate code using openapi. Look at
codegen/build-oas.sh
to see how this is used.- Make sure Docker is running.
just build-openapi
- References the spec files from the
codegen/apis
submodule - Outputs the generated code to
src/openapi
- References the spec files from the
Protobuf
brew install protobuf
cargo install protobuf-codegen
and add it to path:PATH="$HOME/.cargo/bin:$PATH"
just build-proto
- References the spec files from the
codegen/apis
submodule - Outputs the generated code to
src/protos
- References the spec files from the
Alternatively, you can run just build-client
to regenerate both OpenAPI and Protobuf code.
What the build process looks like in all cases:
- Build the
apis
submodule to produce consolidated .yaml files incodegen/apis/_build
- Create a
version.rs
file containing API version info based on the defined value in the justfile - Run build scripts for OpenAPI and/or Protobuf, propagating the API version
Build and run the project:
cargo build
builds the projectcargo test
builds the project and runs tests