OpenAPI constructor
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
- required Info info,
- required String openapi,
- List<
Server> ? servers, - @Default.new({}) Map<
String, PathItem> paths, - Components? components,
- String? jsonSchemaDialect,
- @Default.new([]) List<
SecurityRequirement> security, - @Default.new([]) List<
Tag> tags, - ExternalDocs? externalDocs,
- @Default.new({}) Map<
String, PathItem> webhooks, - @JsonKey.new(includeIfNull: false, includeFromJson: false, includeToJson: false) Map<
String, dynamic> ? extensions,
Creates an OpenAPI with the given parameters.
Implementation
@JsonSerializable(includeIfNull: false, explicitToJson: true)
const factory OpenAPI({
/// Provides metadata about the API.
required Info info,
/// This string MUST be the semantic version number of the OpenAPI
/// Specification version that the OpenAPI document uses.
required String openapi,
/// An array of Server Objects, which provide connectivity information \
/// to a target server.
List<Server>? servers,
/// The available paths and operations for the API.
@Default({}) Map<String, PathItem> paths,
/// An element to hold reusable objects for the specification.
Components? components,
/// The default value for the $schema keyword within Schema Objects
/// contained within this OAS document. This MUST be in the form of a URI.
String? jsonSchemaDialect,
/// A declaration of which security schemes are applied to the API
/// as a whole.
@Default([]) List<SecurityRequirement> security,
/// A list of tags for API documentation control.
@Default([]) List<Tag> tags,
/// Additional external documentation.
ExternalDocs? externalDocs,
/// The incoming webhooks that MAY be received by the API.
@Default({}) Map<String, PathItem> webhooks,
/// Vendor extensions (keys like `x-*`).
@JsonKey(includeIfNull: false, includeFromJson: false, includeToJson: false)
Map<String, dynamic>? extensions,
}) = _OpenAPI;