Community-maintained Rust client library for Typesense | Work In Progress & Help Wanted!
When updating or adding new parameters and endpoints, make changes directly in the Typesense API spec repository.
Once your changes are merged, you can update this project as follows (you can also run tasks individually):
cargo xtask fetch preprocess code-genThis will:
- Download the latest API spec.
- Write it to our local
openapi.yml. - Preprocess it into
preprocessed_openapi.yml. - Regenerate the
/typesense_codegencrate.
The preprocessing step does two things:
- Flatten the URL params defined as objects into individual URL parameters (in
preprocess_openapi.rs) - Inject OpenAPI vendor attributes (e.g., generic parameters, schema builders) into the spec before code generation (in
add_vendor_attributes.rs)
You can also run code-gen directly through Docker:
docker run --rm \
-v $PWD:/local openapitools/openapi-generator-cli generate \
-i /local/preprocessed_openapi.yml \
-g rust \
-o /local/typesense_codegen \
-t /local/openapi-generator-template \
--additional-properties library=reqwest \
--additional-properties supportMiddleware=true \
--additional-properties useSingleRequestParameter=true
Make sure you have a Typesense server up and running:
docker compose upThen run this command in the root folder to run the integration tests:
cargo test-clean -- --all-featuresThis is an alias command which will run a script to clean up your Typesense server after the tests finish. You can pass any arguments of cargo test after the --.
To run test for wasm (chrome, headless):
cargo test-clean --wasmIf you'd like to contribute, please join our Slack Community and say hello!