#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

#332 in Parser implementations

Download history 22/week @ 2023-12-07 82/week @ 2023-12-14 4/week @ 2023-12-21 45/week @ 2023-12-28 65/week @ 2024-01-04 120/week @ 2024-01-11 94/week @ 2024-01-18 94/week @ 2024-01-25 74/week @ 2024-02-01 59/week @ 2024-02-08 228/week @ 2024-02-15 276/week @ 2024-02-22 91/week @ 2024-02-29 312/week @ 2024-03-07 116/week @ 2024-03-14 73/week @ 2024-03-21

608 downloads per month
Used in 3 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

~7–22MB
~329K SLoC