oas3 0.22.0

Structures and tools to parse, navigate, and validate OpenAPI v3.1.x specifications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Demonstrates reading an OpenAPI spec file and printing back to stdout.

use std::{env, fs};

fn main() -> eyre::Result<()> {
    let Some(path) = env::args().nth(1) else {
        return Ok(());
    };

    let yaml = fs::read_to_string(path)?;
    let spec = oas3::from_yaml(yaml)?;
    println!("{}", oas3::to_yaml(&spec).unwrap());

    Ok(())
}