6 releases

Uses old Rust 2015

0.1.5 Apr 30, 2017
0.1.4 Apr 26, 2017

#75 in #swagger

Download history 202/week @ 2025-10-22 162/week @ 2025-10-29 450/week @ 2025-11-05 187/week @ 2025-11-12 173/week @ 2025-11-19 185/week @ 2025-11-26 329/week @ 2025-12-03 227/week @ 2025-12-10 546/week @ 2025-12-17 178/week @ 2025-12-24 413/week @ 2025-12-31 314/week @ 2026-01-07 351/week @ 2026-01-14 235/week @ 2026-01-21 549/week @ 2026-01-28 490/week @ 2026-02-04

1,660 downloads per month
Used in 3 crates (2 directly)

MIT license

94KB
190 lines

Openapi provides structures and support for serializing and deserializing openapi specifications

Examples

Typical use deserialing an existing to a persisted spec to rust form of visa versa

The hyper client should be configured with tls.

extern crate openapi;

fn main() {
  match openapi::from_path("path/to/openapi.yaml") {
    Ok(spec) => println!("spec: {:?}", spec),
    Err(err) => println!("error: {}", err)
  }
}

Errors

Operations typically result in a openapi::Result Type which is an alias for Rust's built-in Result with the Err Type fixed to the openapi::errors::Error enum type. These are provided using error_chain crate so their shape and behavior should be consistent and familiar to existing error_chain users.


open api Build Status

Rust crate for serializing and deserializing open api documents

Documentation

install

add the following to your Cargo.toml file

[dependencies]
openapi = "0.1"

usage

extern crate openapi;

fn main() {
  match openapi::from_path("path/to/openapi.yaml") {
    Ok(spec) => println!("spec: {:?}", spec),
    Err(err) => println!("error: {}", err)
  }
}

Doug Tangren (softprops) 2017

Dependencies

~6.5MB
~134K SLoC