Expand description
OpenAPI 3.1 specification support
This module provides OpenAPI 3.1.0 specification generation with full JSON Schema 2020-12 support and webhook definitions.
§Key differences from OpenAPI 3.0
- Full JSON Schema 2020-12 compatibility
- Webhooks support at the root level
- Nullable types use type arrays instead of
nullable: true - Support for
$refwith sibling keywords
§Example
ⓘ
use rustapi_openapi::v31::{OpenApi31Spec, Webhook};
let spec = OpenApi31Spec::new("My API", "1.0.0")
.description("An example API")
.webhook("orderPlaced", Webhook::with_summary("Order placed event"))
.build();Structs§
- ApiInfo31
- API information for OpenAPI 3.1
- Callback
- Callback definition
- Components31
- Components container (schemas, security schemes, etc.)
- Contact
- Contact information
- Discriminator
- Discriminator for polymorphism
- Example
- Example object
- External
Docs - External documentation
- External
Documentation - External documentation
- Header
- Response header
- Json
Schema2020 - JSON Schema 2020-12 schema definition
- License
- License information
- Media
Type Object - Media type object
- OAuth
Flow - OAuth2 flow
- OAuth
Flows - OAuth2 flows
- Open
Api31 Spec - OpenAPI 3.1.0 specification
- Schema
Transformer - Transformer for converting OpenAPI 3.0 schemas to 3.1
- Security
Scheme - Security scheme definition
- Server
- Server definition
- Server
Variable - Server variable
- Tag
- Tag for grouping operations
- Webhook
- Webhook definition for OpenAPI 3.1
- Webhook
Operation - Webhook operation (similar to path operation)
- Webhook
Request Body - Request body for webhook
- Webhook
Response - Webhook response
- Xml
- XML metadata
Enums§
- Additional
Properties - Additional properties can be a boolean or a schema
- Type
Array - Type array for nullable types in JSON Schema 2020-12