Crate oas3

Source
Expand description

Structures and tools to parse, navigate and validate OpenAPI v3.1 specifications.

Note that due to v3.1 being a breaking change from v3.0, you may have trouble correctly parsing specs in the older format.

§Example

let yaml = std::fs::read_to_string("path/to/openapi.yml").unwrap();

match oas3::from_yaml(yaml) {
  Ok(spec) => println!("spec: {:?}", spec),
  Err(err) => println!("error: {}", err)
}

Re-exports§

pub use self::spec::Spec;

Modules§

spec
Structures used in parsing and navigating OpenAPI specifications.

Functions§

from_json
Deserializes an OpenAPI spec (JSON-format) from a string.
to_json
Serializes OpenAPI spec to a JSON string.

Type Aliases§

OpenApiV3Spec
Version 3.1.0 of the OpenAPI specification.