#openapi #v3


Fork of openapiv3 crate. Provides additional methods to simplify working with openapiv3 structs.

8 stable releases

1.0.10 Sep 2, 2022
1.0.8 Aug 23, 2022
1.0.4 Jun 13, 2022
1.0.3 May 12, 2022
1.0.1 Apr 12, 2022

#214 in Rust patterns

Download history 14/week @ 2022-08-12 97/week @ 2022-08-19 12/week @ 2022-08-26 39/week @ 2022-09-02 27/week @ 2022-09-09 29/week @ 2022-09-16 12/week @ 2022-09-23 33/week @ 2022-09-30 12/week @ 2022-10-07 3/week @ 2022-10-14 13/week @ 2022-10-21 16/week @ 2022-10-28 13/week @ 2022-11-04 14/week @ 2022-11-11 25/week @ 2022-11-18 7/week @ 2022-11-25

61 downloads per month
Used in openapi-client-generator


1.5K SLoC

OpenAPI v3 example workflow

This crate provides data structures that represent the OpenAPI v3.0.x specification. Note this does not cover OpenAPI v3.1 which was an incompatible change.


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);


  • 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.


Schemas without a type will end up 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


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)


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.


~40K SLoC