{"id":28387582,"url":"https://github.com/idemio/oasert","last_synced_at":"2026-03-03T21:02:54.770Z","repository":{"id":294087715,"uuid":"985942882","full_name":"idemio/OASert","owner":"idemio","description":"Simple library to validate payloads against OpenAPI Specification(s)","archived":false,"fork":false,"pushed_at":"2025-08-11T20:04:19.000Z","size":244,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-03T03:39:57.795Z","etag":null,"topics":["api","oas3","openapi","openapi-specification","openapi2","openapi3","rest","validation"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idemio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-18T20:53:05.000Z","updated_at":"2025-08-13T13:34:41.000Z","dependencies_parsed_at":"2025-06-18T00:23:56.029Z","dependency_job_id":"502cb19b-b942-433f-aff0-cbaae25f42fb","html_url":"https://github.com/idemio/OASert","commit_stats":null,"previous_names":["idemio/payload-validator","idemio/openapi-payload-validator","idemio/oasert"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/idemio/OASert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idemio%2FOASert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idemio%2FOASert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idemio%2FOASert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idemio%2FOASert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idemio","download_url":"https://codeload.github.com/idemio/OASert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idemio%2FOASert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30060680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","oas3","openapi","openapi-specification","openapi2","openapi3","rest","validation"],"created_at":"2025-05-30T18:37:58.589Z","updated_at":"2026-03-03T21:02:54.754Z","avatar_url":"https://github.com/idemio.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OASert\n\n**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\nensure strict compliance with defined API contracts during request processing.\n\n[![codecov](https://codecov.io/gh/idemio/OASert/branch/main/graph/badge.svg)](https://codecov.io/gh/idemio/OASert)\n[![CI Status](https://github.com/idemio/OASert/workflows/Rust/badge.svg)](https://github.com/idemio/OASert/actions)\n\n---\n\n## Core Capabilities\n\n- **Comprehensive Request Validation**  \n  Performs rigorous validation of HTTP request elements (payloads, headers, query parameters, path parameters) against OpenAPI v3.x specifications, ensuring complete compliance with defined schemas.\n\n- **High-Performance Validator Caching**  \n  Implements a thread-safe, concurrent caching infrastructure powered by `DashMap` (v7.0) that minimizes redundant validator instantiations and optimizes memory usage.\n\n- **Advanced Specification Traversal**  \n  Provides sophisticated algorithms for navigating complex OpenAPI documents, with robust handling of nested `$ref` references through pointer resolution and circular reference detection.\n\n- **Validation Error Reporting**  \n  Detailed error reporting with specific categories like missing properties, invalid types, or unsupported schema versions.\n\n- **Supports OpenAPI Drafts**  \n  Includes support for both OpenAPI 3.0.x (Draft 4) and OpenAPI 3.1.x (Draft 2020–12).\n\n- **Supports Partial Validation**\n  Allows for partial validation of requests (i.e. validate headers, validate scopes, validate body, etc.)\n\n- **Runtime Agnostic**\n  Does not depend on any specific runtime and can be dropped in where needed (i.e., hyper, aws lambda, etc.)\n\n---\n\n## Installation\n\nAdd `OASert` to your `Cargo.toml`:\n\n```toml \n[dependencies]\noasert = \"0.1.1\"\n``` \n\n---\n\n## Basic Usage\n\n### Initializing the Validator\n\n1. Parse your OpenAPI specification into a `serde_json::Value`.\n2. Create an `OpenApiPayloadValidator` using the parsed specification.\n3. Pass incoming requests to the validator\n\nSee a full example using hyper [here](./examples/hyper-validation/main.rs)\nSee a full example using AWS Lambda [here](./examples/aws-lambda-http-validation/main.rs)\n\n## Components\n\n### 1. `ValidatorCache`\n\nEfficient caching mechanism for validators to avoid repeated instantiations.\n\n- Insert or retrieve validators dynamically.\n- Clear the cache when needed.\n- Automatically create validators for specific IDs if not cached.\n\n### 2. `OpenApiTraverser`\n\nUtility class to traverse OpenAPI specifications with support for:\n\n- Resolving `$ref` pointers.\n- Fetching required or optional specification nodes.\n- Handling complex paths and parameters.\n\n### 3. `OpenApiTypes`\n\nType mapping utility to convert OpenAPI types (`string`, `boolean`, etc.) into native Rust types.\n\n### 4. Error Handling\n\nComprehensive error handling for:\n\n- Missing parameters or fields.\n- Unsupported specification versions.\n- Invalid schema values or types.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidemio%2Foasert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidemio%2Foasert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidemio%2Foasert/lists"}