#openapi #validation #swagger #api

oas3

Structures and tools to parse, navigate and validate OpenAPI v3 specifications

5 releases (3 breaking)

0.4.0 Nov 7, 2023
0.3.0 Oct 29, 2023
0.2.1 Oct 12, 2020
0.2.0 Oct 12, 2020
0.0.1 Aug 9, 2019

#348 in Parser implementations

Download history 57/week @ 2024-01-02 117/week @ 2024-01-09 120/week @ 2024-01-16 91/week @ 2024-01-23 65/week @ 2024-01-30 55/week @ 2024-02-06 161/week @ 2024-02-13 333/week @ 2024-02-20 110/week @ 2024-02-27 183/week @ 2024-03-05 247/week @ 2024-03-12 62/week @ 2024-03-19 101/week @ 2024-03-26 141/week @ 2024-04-02 44/week @ 2024-04-09 111/week @ 2024-04-16

408 downloads per month
Used in 5 crates

MIT license

140KB
3K SLoC

OAS3

Structures and tools to parse, navigate and validate OpenAPI v3 Spec files.

Based on v3 parts of openapi crate by softprops.

Additional features:

  • Validation constructors
  • Example request/response validation
  • Live API conformance testing

Install

add the following to your Cargo.toml file

[dependencies]
oas3 = "0.4"

Usage

extern crate oas3;

fn main() {
  match oas3::from_path("path/to/openapi.yaml") {
    Ok(spec) => println!("spec: {:?}", spec),
    Err(err) => println!("error: {}", err)
  }
}

lib.rs:

Structures and tools to parse, navigate and validate OpenAPI v3.1 specifications.

Example

match oas3::from_path("path/to/openapi.yaml") {
  Ok(spec) => println!("spec: {:?}", spec),
  Err(err) => println!("error: {}", err)
}

Dependencies

~8–23MB
~345K SLoC