1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! OpenAPI/Swagger parser for UniStructGen
//!
//! This crate provides a parser that converts OpenAPI 3.0 specifications into
//! UniStructGen's Intermediate Representation (IR), enabling automatic generation
//! of Rust types, API clients, and validation code.
//!
//! # Features
//!
//! - Parse OpenAPI 3.0 specifications (YAML and JSON)
//! - Convert schemas to Rust structs and enums
//! - Generate API client traits with typed methods
//! - Support for request/response validation
//! - Handle references ($ref) and schema composition (allOf, oneOf, anyOf)
//! - Fetch specs from URLs or local files
//!
//! # Examples
//!
//! ```no_run
//! use unistructgen_openapi_parser::{OpenApiParser, OpenApiParserOptions};
//! use unistructgen_core::Parser;
//!
//! let options = OpenApiParserOptions::builder()
//! .generate_client(true)
//! .generate_validation(true)
//! .build();
//!
//! let mut parser = OpenApiParser::new(options);
//! let spec = std::fs::read_to_string("openapi.yaml").unwrap();
//! let ir_module = parser.parse(&spec).unwrap();
//! ```
pub use ;
pub use ;
pub use OpenApiParser;
// Re-export core types for convenience
pub use ;