4 releases
0.1.8 | Mar 12, 2023 |
---|---|
0.1.7 | Nov 3, 2022 |
0.1.6 | May 6, 2022 |
0.1.5 | Apr 30, 2022 |
#40 in #swagger
40 downloads per month
175KB
1K
SLoC
Apple Bloom
Rust crate for serializing and deserializing open api documents
Fork of softprops/openapi
Install
add the following to your Cargo.toml
file
[dependencies]
apple_bloom = "0.1"
Usage
extern crate apple_bloom;
fn main() {
match apple_bloom::from_path("path/to/openapi.yaml") {
Ok(spec) => println!("spec: {:?}", spec),
Err(err) => println!("error: {}", err)
}
}
lib.rs
:
Openapi provides structures and support for serializing and deserializing openapi specifications
Examples
Typical use deserialing an existing to a persisted spec to rust form or visa versa
The hyper client should be configured with tls.
extern crate apple_bloom;
fn main() {
match apple_bloom::from_path("path/to/openapi.yaml") {
Ok(spec) => println!("spec: {:?}", spec),
Err(err) => println!("error: {}", err)
}
}
Errors
Operations typically result in a Result
type, an alias for
std::result::Result
with the Err
type fixed to Error
,
which implements std::error::Error
.
Dependencies
~3.5–4.5MB
~104K SLoC