#openapi #validation #swagger #api

oas3

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

6 releases (breaking)

new 0.5.0 May 18, 2024
0.4.0 Nov 7, 2023
0.3.0 Oct 29, 2023
0.2.1 Oct 12, 2020
0.0.1 Aug 9, 2019

#428 in Parser implementations

Download history 82/week @ 2024-01-26 66/week @ 2024-02-02 68/week @ 2024-02-09 230/week @ 2024-02-16 271/week @ 2024-02-23 101/week @ 2024-03-01 323/week @ 2024-03-08 105/week @ 2024-03-15 64/week @ 2024-03-22 126/week @ 2024-03-29 99/week @ 2024-04-05 80/week @ 2024-04-12 154/week @ 2024-04-19 175/week @ 2024-04-26 88/week @ 2024-05-03 48/week @ 2024-05-10

489 downloads per month
Used in 6 crates

MIT license

140KB
3K SLoC

OAS3

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

Based on v3 parts of the 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

~7–23MB
~316K SLoC