docs.rs failed to build harbor-api-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
harbor-api-2.0.0
Harbor API Rust Client
A Rust client library for the Harbor API, automatically generated from their OpenAPI specification.
Features
- Fully typed API client generated from Harbor's OpenAPI spec
- Async/await support with tokio
- Automatic retry and error handling via progenitor
- Builder pattern for constructing API requests
Installation
Add this to your Cargo.toml:
[]
= { = "https://github.com/AprilNEA/harbor-api" }
Usage
use Client;
async
Building from Source
This project uses a build script to generate the API client from Harbor's OpenAPI specification.
Prerequisites
- Rust 1.70 or later
- Internet connection (for fetching the OpenAPI spec during build)
Build
Custom API Spec
You can override the default API specification URL by setting the SPEC_URL environment variable:
SPEC_URL=https://your-harbor-instance.com/api/swagger.json
Development
The API client is generated at build time using progenitor. The build script:
- Fetches the OpenAPI specification from Harbor's API
- Ensures all operations have unique operation IDs
- Filters out unsupported operations (e.g., multipart/form-data)
- Generates type-safe Rust code
Project Structure
harbor-api/
├── Cargo.toml # Project dependencies
├── build.rs # Build script for code generation
├── src/
│ └── lib.rs # Library entry point (includes generated code)
└── target/
└── debug/
└── build/.../out/
└── codegen.rs # Generated API client code
Known Limitations
- Operations that use
multipart/form-datacontent type are not supported and are filtered out during code generation - The generated client requires an active internet connection during the build process to fetch the API specification
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is open source. Please check the repository for license details.
Author
- AprilNEA - GitHub
Acknowledgments
- Harbor for providing the API
- progenitor for the excellent OpenAPI code generation tools