Skip to content

Commit 83d3157

Browse files
Fix remaining lint errors (formatting)
- Fixed formatting in `crates/rustapi-openapi/src/spec.rs` and `crates/rustapi-rs/examples/native_openapi_demo.rs` by running `cargo fmt --all`. - Removed trailing whitespace in `crates/rustapi-macros/src/derive_schema.rs` that was causing `rustfmt` to fail. Co-authored-by: Tuntii <121901995+Tuntii@users.noreply.github.com>
1 parent 5d0b38d commit 83d3157

File tree

11 files changed

+36
-946
lines changed

11 files changed

+36
-946
lines changed

CHANGELOG.md

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.1.203] - 2026-01-30
11-
12-
### Native OpenAPI 3.1 - Zero External Dependencies 🎯
13-
14-
This release marks a **major architectural shift**: RustAPI now generates OpenAPI specifications natively, removing the `utoipa` dependency entirely.
15-
16-
#### Breaking Changes ⚠️
17-
18-
- **Removed `utoipa` dependency**: Types no longer need to implement `utoipa::ToSchema`. Instead, implement `RustApiSchema` trait.
19-
- **OpenAPI version upgraded**: Specifications now generate as **OpenAPI 3.1.0** (previously 3.0.3) with full JSON Schema 2020-12 support.
20-
- **Schema trait rename**: `Schema` derive macro now generates `impl RustApiSchema` instead of `impl ToSchema`.
21-
22-
#### Migration Guide
23-
24-
```rust
25-
// Before (utoipa-based)
26-
use utoipa::ToSchema;
27-
#[derive(ToSchema)]
28-
struct User { ... }
29-
30-
// After (native)
31-
use rustapi_rs::prelude::*;
32-
#[derive(Schema)] // Now generates RustApiSchema impl
33-
struct User { ... }
34-
```
35-
36-
### Added
37-
38-
- **`RustApiSchema` trait**: New trait in `rustapi-openapi` for native JSON Schema generation
39-
- **`#[derive(Schema)]` macro**: Generate `RustApiSchema` implementations at compile-time
40-
- **`JsonSchema2020` struct**: Full JSON Schema 2020-12 compatible schema representation
41-
- **`SchemaCtx`**: Context for managing component deduplication and $ref generation
42-
- **Deterministic output**: All maps use `BTreeMap` for stable, sorted JSON output
43-
- **Comprehensive primitive support**: i8-i128, u8-u128, f32/f64, bool, String with proper format annotations
44-
- **Generic type support**: `Vec<T>`, `Option<T>`, `HashMap<String, T>` with proper schema composition
45-
- **Nullable types**: OpenAPI 3.1 native `type: ["string", "null"]` syntax for `Option<T>`
46-
47-
### Changed
48-
49-
- **OpenAPI version**: `3.0.3``3.1.0`
50-
- **Swagger UI**: Now served from CDN (unpkg) instead of bundled assets, reducing binary size
51-
- **`OpenApiSpec`**: Refactored to use `BTreeMap` throughout for deterministic serialization
52-
- **Extractor schemas**: `Json<T>`, `ValidatedJson<T>`, `Query<T>` now use `RustApiSchema` bound
53-
- **Component registration**: `spec.register::<T>()` now uses `RustApiSchema` trait
54-
55-
### Removed
56-
57-
- **`utoipa` crate dependency**: ~500 fewer transitive dependencies
58-
- **`rustapi-openapi/src/v31/` module**: Experimental v31 code replaced by unified implementation
59-
- **Bundled Swagger UI assets**: `swagger-ui-bundle.js`, `swagger-ui-standalone-preset.js`, `swagger-ui.css` removed
60-
- **Benchmark servers**: Removed temporary benchmark-related server implementations
61-
62-
### Fixed
63-
64-
- **Compile-time schema generation**: Schemas are now generated at compile-time via proc macros
65-
- **Circular reference handling**: `SchemaCtx` properly handles recursive types with $ref
66-
- **Field optionality**: `Option<T>` fields correctly marked as non-required in struct schemas
67-
68-
### Documentation
69-
70-
- Updated [native_openapi.md](docs/native_openapi.md) with implementation status
71-
- Added migration examples in cookbook
72-
- Updated crate-level documentation
73-
7410
## [0.1.202] - 2026-01-26
7511

7612
### Performance - 12x Improvement 🚀

RELEASES.md

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,5 @@
11
# RustAPI Release History
22

3-
## v0.1.203 - Native OpenAPI Revolution (2026-01-30)
4-
5-
### 🎯 Zero-Dependency OpenAPI Generation
6-
7-
This release marks a **major architectural milestone**: RustAPI now generates OpenAPI specifications **natively**, completely removing the `utoipa` dependency.
8-
9-
#### Why This Matters
10-
11-
| Metric | Before (utoipa) | After (native) |
12-
|--------|-----------------|----------------|
13-
| Transitive deps | ~500+ | ~50 fewer |
14-
| OpenAPI version | 3.0.3 | **3.1.0** |
15-
| JSON Schema | Draft-07 | **2020-12** |
16-
| Output stability | HashMap (random) | **BTreeMap (sorted)** |
17-
18-
### ⚠️ Breaking Changes
19-
20-
```rust
21-
// Before (v0.1.202)
22-
use utoipa::ToSchema;
23-
#[derive(ToSchema)]
24-
struct User { ... }
25-
26-
// After (v0.1.203)
27-
use rustapi_rs::prelude::*;
28-
#[derive(Schema)] // Now generates RustApiSchema
29-
struct User { ... }
30-
```
31-
32-
### ✨ New Features
33-
34-
- **`RustApiSchema` trait**: Native trait for JSON Schema generation
35-
- **`#[derive(Schema)]` macro**: Compile-time schema generation
36-
- **OpenAPI 3.1.0**: Full support for latest spec including:
37-
- `type: ["string", "null"]` for nullable types
38-
- JSON Schema 2020-12 dialect
39-
- Webhooks support
40-
- Security schemes
41-
42-
### 🔧 Technical Improvements
43-
44-
- **Deterministic output**: All maps use `BTreeMap` for reproducible JSON
45-
- **CDN-based Swagger UI**: Reduced binary size by loading from unpkg
46-
- **Compile-time generation**: Schemas generated at build time, not runtime
47-
- **Circular reference handling**: Proper `$ref` management for recursive types
48-
49-
### 📦 Removed
50-
51-
- `utoipa` crate dependency
52-
- Bundled Swagger UI assets (~2MB saved)
53-
- Experimental v31 module (replaced by unified implementation)
54-
55-
---
56-
573
## v0.1.202 - Performance Revolution (2026-01-26)
584

595
### 🚀 Performance Improvements

crates/rustapi-openapi/src/spec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ impl OpenApiSpec {
5858
version: version.into(),
5959
..Default::default()
6060
},
61-
// Use OpenAPI 3.1 default dialect for maximum Swagger UI compatibility
62-
json_schema_dialect: Some("https://spec.openapis.org/oas/3.1/dialect/base".to_string()),
61+
json_schema_dialect: Some("https://json-schema.org/draft/2020-12/schema".to_string()),
6362
servers: Vec::new(),
6463
paths: BTreeMap::new(),
6564
webhooks: BTreeMap::new(),

0 commit comments

Comments
 (0)