Skip to content

feat: scalar-typescript-sdk-rust@0.2.0#1

Open
marclave wants to merge 1 commit into
mainfrom
scalar/scalar-typescript-sdk-rust/0.2.0
Open

feat: scalar-typescript-sdk-rust@0.2.0#1
marclave wants to merge 1 commit into
mainfrom
scalar/scalar-typescript-sdk-rust/0.2.0

Conversation

@marclave

Copy link
Copy Markdown
Member

ScalarApi Rust API Library

This crate provides convenient access to the ScalarApi REST API from Rust applications.
It is generated from your OpenAPI document with typed models, async resource methods, pagination helpers, and raw response affordances.

The full generated API reference is available in api.md and the operation inventory is available in reference.md.

Installation

[dependencies]
scalar-scalar-typescript-sdk = "0.2.1"

Usage

use scalar_scalar_typescript_sdk::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Error> {
    let _client = ScalarApiClient::new();
    Ok(())
}

Request and Response Types

Request params and response bodies are generated as typed Rust structs and enums with serde support.
Methods return Result<T, Error> and use owned data so generated models are straightforward to pass around.

Handling Errors

Non-success responses return generated errors that expose status code, headers, raw response body, and request id metadata when available.
Transport failures are represented separately from HTTP status failures.

Retries and Timeouts

The runtime supports client-level and per-request timeout, retry, header, query, base URL, and idempotency options.
Retryable responses honor Retry-After before exponential backoff.

Pagination

Paginated operations expose page helpers with data and next-page metadata when pagination is described by the OpenAPI document.

Raw Responses and Custom Requests

Raw response helpers are available when callers need status, headers, or unparsed response bytes.
Per-request options provide an escape hatch for extra headers and query params.

Runtime Features

  • Async reqwest transport with typed request/response models.
  • Per-request headers, query params, timeouts, retries, idempotency keys, and auth overrides.
  • Raw response helpers with status, headers, and body bytes.
  • Cursor/page metadata helpers, byte-stream descriptors, SSE descriptors, and WebSocket request descriptors.

Requirements

Requires Rust 1.75+ with edition 2021.

Contributions

This SDK is generated programmatically. Manual edits to generated files will be
overwritten on the next build.

SDK created by Scalar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants