| Crates.io | reflectapi-cli |
| lib.rs | reflectapi-cli |
| version | 0.16.5 |
| created_at | 2024-04-23 09:29:37.397722+00 |
| updated_at | 2026-01-06 02:29:34.507843+00 |
| description | CLI for reflectapi |
| homepage | https://github.com/thepartly/reflectapi |
| repository | https://github.com/thepartly/reflectapi |
| max_upload_size | |
| id | 1217329 |
| size | 56,332 |
reflectapi is a library and a toolkit for writing web API services in Rust and generating compatible clients, delivering great development experience and efficiency.
Ensure that you have prettier and rustfmt available in your PATH to format generated code.
To run the demo server:
cargo run --bin reflectapi-demo
To generate client in Typescript for demo server:
cargo run --bin reflectapi -- codegen --language typescript --schema reflectapi-demo/reflectapi.json --output reflectapi-demo/clients/typescript
To run the Typescript generated client. Note: requires the demo server running
cd reflectapi-demo/clients/typescript/
npm install
npm run start
To generate client in Rust for demo server:
cargo run --bin reflectapi -- codegen --language rust --schema reflectapi-demo/reflectapi.json --output reflectapi-demo/clients/rust/generated/src/
To run the Rust generated client. Note: requires the demo server running
cd reflectapi-demo/clients/rust/
cargo run --all-features
To generate client in Python for demo server:
cargo run --bin reflectapi -- codegen --language python --schema reflectapi-demo/reflectapi.json --output reflectapi-demo/clients/python
This project uses insta for snapshot testing to ensure code generation output is correct and stable. When tests fail due to snapshot mismatches:
# Interactive review (recommended)
cargo insta review
# Auto-accept all changes (use with caution)
cargo insta accept
cargo test
# Install required tools (one-time setup)
cargo install mdbook mdbook-keeper
# Build documentation
cd docs
mdbook build
# Serve documentation locally
mdbook serve # Opens at http://localhost:3000
# Note: mdbook-keeper automatically runs doctests during build
# The build command both generates HTML and tests code examples
cargo release --exclude reflectapi-demo --exclude reflectapi-demo-client --exclude reflectapi-demo-client-generated minor --execute