Crates.io | boavizta_api_sdk |
lib.rs | boavizta_api_sdk |
version | 1.3.0 |
source | src |
created_at | 2022-10-05 10:08:32.49741 |
updated_at | 2024-10-25 09:43:21.26241 |
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 | 571,923 |
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 generate -i https://api.boavizta.org/openapi.json -g rust -o /local/ --package-name boavizta_api_sdk
# Local API (dev, using network host /!\)
docker run --network=host --rm -v "${PWD}:/local" openapitools/openapi-generator-cli 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 = "2018"
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.11"
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