kpl-derive
A Rust procedural macro library for generating API client code for stock API endpoints.
Features
ApiEndpointderive macro for generating API client code- Customizable endpoint configuration via attributes
- Support for different HTTP methods and response types
- Automatic serialization and deserialization of request parameters and responses
Installation
Add this to your Cargo.toml:
[]
= "0.1.1"
Usage
use ApiEndpoint;
use ;
// Define your response type
// Define your API endpoint
// Use the generated code
async
Attribute Options
The #[endpoint(...)] attribute supports the following options:
name: A display name for the endpoint (required)method: HTTP method to use (default: "GET")path: API path (default: "/w1/api/index.php")host: API host (default: "apphis.longhuvip.com")resp: Response type (default: serde_json::Value)