Crates.io | boavizta_api_sdk |
lib.rs | boavizta_api_sdk |
version | 1.3.3 |
source | src |
created_at | 2022-10-05 10:08:32.49741 |
updated_at | 2024-12-11 11:19:51.089208 |
description | A Rust client/sdk to access Boavizta API |
homepage | https://boavizta.org |
repository | https://github.com/Boavizta/boaviztapi-sdk-rust/ |
max_upload_size | |
id | 680409 |
size | 572,097 |
Rust client library for Boaviztapi.
SDK is generated from the published openAPI specification of Boaviztapi (http://api.boavizta.org/openapi.json).
We use openapi-generator-cli to generate the SDK. See GitHub - OpenAPITools/openapi-generator-cli: A node package wrapper for https://github.com/OpenAPITools/openapi-generator .
# Generate for public API
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.10.0 generate -i https://api.boavizta.org/openapi.json -g rust -o /local/ --package-name boavizta_api_sdk
# Generate against a Local API (dev, using network host /!\)
docker run --network=host --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.10.0 generate -i http://localhost:5000/openapi.json -g rust -o /local/ --package-name boavizta_api_sdk
The generated code require some manual updates before being usable.
To generate the SDK for a specific version of BoaviztaAPI (e.g. a dev branch or unreleased version), you have to:
Metadata of Cargo.toml are overwritten by generation.
description = "A Rust client/sdk to access Boavizta API"
homepage = "https://boavizta.org"
repository = "https://github.com/Boavizta/boaviztapi-sdk-rust/"
readme = "README.md"
authors = ["boavizta.org", "olivier de Meringo"]
edition = "2021"
license-file = "LICENSE"
Ensure that the dependency on reqwest
does not use native SSL(the default feature), but uses rust-tls
. It makes cross compiling so much easier.
[dependencies.reqwest]
version = "^0.12"
default-features = false
features = ["json", "multipart", "rustls-tls"]
This is a manual action and should be done only by the maintainer of the SDK.
cargo login
cargo publish --dry-run
cargo publish