Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
run: cargo fmt -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Run clippy
run: cargo clippy -- -D warnings
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2024-11-03

### Added
- Initial release of ServiceStack Rust client library
- `JsonServiceClient` for making typed API requests to ServiceStack services
- Support for all HTTP methods (GET, POST, PUT, DELETE, PATCH)
- `ServiceStackRequest` trait for defining request DTOs
- `ServiceStackResponse` trait for defining response DTOs
- Bearer token authentication support
- Custom error types with detailed error messages
- Async/await support using tokio and reqwest
- Comprehensive test suite with unit and integration tests
- Multiple usage examples demonstrating all features
- Complete API documentation
- CI/CD workflow for automated testing

### Features
- Type-safe API requests using Rust DTOs
- Follows ServiceStack REST API conventions
- Customizable HTTP client configuration
- Flexible error handling
- Support for custom HTTP methods in request DTOs
- Raw request method for advanced use cases
## [0.1.0] - 2025-11-03

### Added
Expand Down
112 changes: 112 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Contributing to ServiceStack Rust

Thank you for your interest in contributing to the ServiceStack Rust client library!

## Getting Started

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/servicestack-rust.git`
3. Create a branch: `git checkout -b feature/your-feature-name`

## Development Setup

### Prerequisites

- Rust 1.70 or later
- Cargo (comes with Rust)

### Building the Project

```bash
cargo build
```

### Running Tests

```bash
# Run all tests
cargo test

# Run with output
cargo test -- --nocapture

# Run specific test
cargo test test_name
```

### Running Examples

```bash
cargo run --example basic_usage
cargo run --example complete_example
```

## Code Quality

Before submitting a PR, please ensure:

### 1. Format your code

```bash
cargo fmt
```

### 2. Check for linting issues

```bash
cargo clippy -- -D warnings
```

### 3. All tests pass

```bash
cargo test
```

### 4. Build in release mode

```bash
cargo build --release
```

## Pull Request Process

1. Update the README.md with details of changes if applicable
2. Add tests for any new functionality
3. Ensure all tests pass
4. Update examples if the API has changed
5. Write clear commit messages
6. Create a pull request with a clear description of the changes

## Code Style

- Follow Rust naming conventions
- Use meaningful variable and function names
- Add documentation comments for public APIs
- Keep functions focused and small
- Write tests for new features

## Adding New Features

When adding new features:

1. Add unit tests in the relevant module
2. Add integration tests in the `tests/` directory if needed
3. Update documentation and examples
4. Consider backward compatibility

## Reporting Issues

When reporting issues, please include:

- Rust version (`rustc --version`)
- Operating system
- Minimal code example that reproduces the issue
- Expected behavior
- Actual behavior

## Questions?

Feel free to open an issue for any questions about contributing.

Thank you for contributing to ServiceStack Rust!
Loading
Loading