#openapi #v3

openapiv3

This crate aims to provide data structures that represent the Open API v3 specification easily deserializable with serde

10 unstable releases (4 breaking)

new 0.5.0 May 3, 2021
0.4.0 Mar 4, 2021
0.3.3 Mar 1, 2021
0.3.2 May 20, 2020
0.1.3 Mar 5, 2019

#105 in Data structures

Download history 719/week @ 2021-01-16 1054/week @ 2021-01-23 1434/week @ 2021-01-30 1685/week @ 2021-02-06 1397/week @ 2021-02-13 1521/week @ 2021-02-20 1723/week @ 2021-02-27 1422/week @ 2021-03-06 1395/week @ 2021-03-13 1583/week @ 2021-03-20 1802/week @ 2021-03-27 1735/week @ 2021-04-03 1947/week @ 2021-04-10 1885/week @ 2021-04-17 1903/week @ 2021-04-24 1978/week @ 2021-05-01

7,066 downloads per month
Used in 14 crates (12 directly)

MIT/Apache

370KB
1K SLoC

OpenAPI v3 Build Status

This crate aims to provide data structures that represent the Open API v3 specification.

Example

use serde_json;
use openapiv3::OpenAPI;

fn main() {
    let data = include_str!("openapi.json");
    let openapi: OpenAPI = serde_json::from_str(data).expect("Could not deserialize input");
    println!("{:?}", openapi);
}

Goals

  • Provide a deserialization for the specification that maps cleanly to Rust enums etc.

Non Goals

  • Deserialization and subsequent re-serialization are 100% the same.
    • Some defaults show-up when serializing that may not have existed in the input.

Issues

Schemas without a type will endup as any data type as per the specification and can have any parameters of any schema type. Some Open API documents don't include the type parameter it would be nice to try to derive the type but the crate as of right now meets my needs.

Similar Crates

License

This crate is licensed under either of

Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.6–2.4MB
~54K SLoC