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 code-gen
This will:
- Download the latest API spec.
- Write it to our local
openapi.yml
. - Preprocess it into
preprocessed_openapi.yml
. - Regenerate the
/typesense_codegen
crate.
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
If you'd like to contribute, please join our Slack Community and say hello!