Skip to content

Commit be55427

Browse files
committed
chore: release 0.1.3
1 parent e8fa753 commit be55427

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[package]
22
name = "uapi-sdk-rust"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
description = "UAPI Rust SDK - idiomatic, typed, domain-driven API client."
77
repository = "https://github.com/AxT-Team/uapi-sdk-rust"
8+
documentation = "https://docs.rs/uapi-sdk-rust"
89
readme = "README.md"
910
keywords = ["uapi", "sdk", "api", "client"]
1011
categories = ["api-bindings", "web-programming::http-client"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
[![Rust](https://img.shields.io/badge/Rust-1.75+-DEA584?style=flat-square&logo=rust&logoColor=white)](https://www.rust-lang.org/)
66
[![Docs](https://img.shields.io/badge/Docs-uapis.cn-2EAE5D?style=flat-square)](https://uapis.cn/)
7+
[![docs.rs](https://img.shields.io/docsrs/uapi-sdk-rust?label=docs.rs&style=flat-square)](https://docs.rs/uapi-sdk-rust)
78

89
> [!NOTE]
910
> 所有接口的 Rust 示例都可以在 [UApi](https://uapis.cn/docs/introduction) 的接口文档页面,向下滚动至 **快速启动** 区块后直接复制。

src/client.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use std::time::Duration;
1212
use tracing::{debug, instrument};
1313
use url::Url;
1414

15-
static DEFAULT_BASE: &str = "https://uapis.cn/api/v1";
16-
static DEFAULT_UA: &str = "uapi-sdk-rust/0.1.2";
15+
static DEFAULT_BASE: &str = "https://uapis.cn/api/v1/";
16+
static DEFAULT_UA: &str = "uapi-sdk-rust/0.1.3";
1717
static DEFAULT_BASE_URL: Lazy<Url> =
1818
Lazy::new(|| Url::parse(DEFAULT_BASE).expect("valid default base"));
1919

@@ -111,7 +111,8 @@ impl Client {
111111
query: Option<Vec<(String, String)>>,
112112
json_body: Option<serde_json::Value>,
113113
) -> Result<T> {
114-
let url = self.base_url.join(path)?;
114+
let clean_path = path.trim_start_matches('/');
115+
let url = self.base_url.join(clean_path)?;
115116
let mut req = self.http.request(method.clone(), url.clone());
116117

117118
let mut merged = HeaderMap::new();

0 commit comments

Comments
 (0)