Crates.io | oapi_derive |
lib.rs | oapi_derive |
version | 0.1.2 |
source | src |
created_at | 2021-01-29 00:49:48.596549 |
updated_at | 2021-05-02 20:45:56.245981 |
description | Derive macro for OApi |
homepage | |
repository | https://github.com/basiliqio/oapi |
max_upload_size | |
id | 347844 |
size | 8,796 |
An OpenApi documents parser
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.
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);
}