3 releases

0.1.2 May 2, 2021
0.1.1 Apr 29, 2021
0.1.0 Jan 29, 2021

#75 in #swagger

Download history 9/week @ 2024-02-18 44/week @ 2024-02-25 8/week @ 2024-03-03 19/week @ 2024-03-10 5/week @ 2024-03-17

76 downloads per month
Used in oapi

MIT/Apache

9KB
195 lines

OApi

An OpenApi documents parser

Introduction

This librairy aims to help deserialize and work with OpenApi documents.

Built on top of serde and sppparse, it facilitate parsing OpenApi document, even with $ref pointers and user defined extensions.

Example

extern crate oapi;
extern crate sppparse;

use oapi::OApi;
use sppparse::SparseRoot;
use std::path::PathBuf;

fn main() {
    let doc: OApi = OApi::new(
        SparseRoot::new_from_file(PathBuf::from(concat!(
            env!("CARGO_MANIFEST_DIR"),
            "/tests/documents/test_docs/openapi.yml"
        )))
        .expect("to parse the openapi"),
    );

    doc.check().expect("not to have logic errors");
    println!("{:#?}", doc);
}

Dependencies

~2MB
~45K SLoC