#openapi #validation #swagger #api

oas3

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

10 releases (breaking)

0.8.1 Jun 30, 2024
0.7.0 Jun 30, 2024
0.4.0 Nov 7, 2023
0.2.1 Oct 12, 2020
0.0.1 Aug 9, 2019

#271 in Parser implementations

Download history 155/week @ 2024-04-01 49/week @ 2024-04-08 109/week @ 2024-04-15 145/week @ 2024-04-22 181/week @ 2024-04-29 73/week @ 2024-05-06 225/week @ 2024-05-13 149/week @ 2024-05-20 123/week @ 2024-05-27 88/week @ 2024-06-03 65/week @ 2024-06-10 94/week @ 2024-06-17 458/week @ 2024-06-24 263/week @ 2024-07-01 78/week @ 2024-07-08 40/week @ 2024-07-15

846 downloads per month
Used in 6 crates

MIT license

160KB
3K SLoC

OAS3

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

Originally based on v3 parts of the openapi crate by softprops.

Additional features:

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

Usage

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.

Note that due to v3.1 being a breaking change from v3.0, you may have trouble correctly parsing specs in the older format.

Example

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

Dependencies

~8–23MB
~365K SLoC