rustapi_openapi/v31/
mod.rs

1//! OpenAPI 3.1 specification support
2//!
3//! This module provides OpenAPI 3.1.0 specification generation with full
4//! JSON Schema 2020-12 support and webhook definitions.
5//!
6//! # Key differences from OpenAPI 3.0
7//!
8//! - Full JSON Schema 2020-12 compatibility
9//! - Webhooks support at the root level
10//! - Nullable types use type arrays instead of `nullable: true`
11//! - Support for `$ref` with sibling keywords
12//!
13//! # Example
14//!
15//! ```rust,ignore
16//! use rustapi_openapi::v31::{OpenApi31Spec, Webhook};
17//!
18//! let spec = OpenApi31Spec::new("My API", "1.0.0")
19//!     .description("An example API")
20//!     .webhook("orderPlaced", Webhook::with_summary("Order placed event"))
21//!     .build();
22//! ```
23
24mod schema;
25mod spec;
26mod webhooks;
27
28#[cfg(test)]
29mod tests;
30
31pub use schema::{
32    AdditionalProperties, Discriminator, ExternalDocumentation, JsonSchema2020, SchemaTransformer,
33    TypeArray, Xml,
34};
35pub use spec::{
36    ApiInfo31, Components31, Contact, ExternalDocs, License, OAuthFlow, OAuthFlows, OpenApi31Spec,
37    SecurityScheme, Server, ServerVariable, Tag,
38};
39pub use webhooks::{
40    Callback, Example, Header, MediaTypeObject, Webhook, WebhookOperation, WebhookRequestBody,
41    WebhookResponse,
42};