| Crates.io | oasert |
| lib.rs | oasert |
| version | 0.1.4 |
| created_at | 2025-05-30 22:41:25.607105+00 |
| updated_at | 2025-06-23 19:45:04.631856+00 |
| description | A library for verifying in-flight requests against a provided OpenAPI 3.1.x or 3.0.x specification. |
| homepage | |
| repository | https://github.com/idemio/OASert |
| max_upload_size | |
| id | 1695739 |
| size | 252,406 |
OASert is a high-performance Rust library for runtime validation of HTTP requests against OpenAPI 3.x specifications. It provides a comprehensive suite of tools for traversing, validating, and caching OpenAPI document structures to ensure strict compliance with defined API contracts during request processing.
Comprehensive Request Validation
Performs rigorous validation of HTTP request elements (payloads, headers, query parameters, path parameters) against OpenAPI v3.x specifications, ensuring complete compliance with defined schemas.
High-Performance Validator Caching
Implements a thread-safe, concurrent caching infrastructure powered by DashMap (v7.0) that minimizes redundant validator instantiations and optimizes memory usage.
Advanced Specification Traversal
Provides sophisticated algorithms for navigating complex OpenAPI documents, with robust handling of nested $ref references through pointer resolution and circular reference detection.
Validation Error Reporting
Detailed error reporting with specific categories like missing properties, invalid types, or unsupported schema versions.
Supports OpenAPI Drafts
Includes support for both OpenAPI 3.0.x (Draft 4) and OpenAPI 3.1.x (Draft 2020-12).
Add OASert to your Cargo.toml:
[dependencies]
oasert = "0.1.1"
serde_json::Value.OpenApiPayloadValidator using the parsed specification.See a full example using hyper here See a full example using AWS Lambda here
ValidatorCacheEfficient caching mechanism for validators to avoid repeated instantiations.
OpenApiTraverserUtility class to traverse OpenAPI specifications with support for:
$ref pointers.OpenApiTypesType mapping utility to convert OpenAPI types (string, boolean, etc.) into native Rust types.
Comprehensive error handling for: