OpenApi constructor
const
OpenApi({
- @Default('3.0.3') @JsonKey(name: 'openapi') String version,
- required Info info,
- ExternalDocs? externalDocs,
- String? jsonSchemaDialect,
- List<
Server> ? servers, - List<
Tag> ? tags, - Map<
String, PathItem> ? paths, - Map<
String, PathItem> ? webhooks, - Components? components,
- List<
Security> ? security, - @Default({}) Map<
String, List< extraSchemaMapping,String> >
Implementation
const factory OpenApi({
/// This string must be the version number of the
/// OpenAPI Specification that the OpenAPI document uses.
/// This is not related to the API [Info.version] string.
/// By default, this generator uses `3.0.3`.
@Default('3.0.3') @JsonKey(name: 'openapi') String version,
/// Provides metadata about the API.
/// The metadata MAY be used by tooling as required.
required Info info,
/// Additional external documentation.
final ExternalDocs? externalDocs,
/// 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,
/// An array of [Server] objects, which provide connectivity information to a target server.
/// If the servers property is not provided, or is an empty array,
/// the default value would be a [Server] object with a url value of `/`.
List<Server>? servers,
/// can be included in the array.
List<Tag>? tags,
/// The available paths and operations for the API.
Map<String, PathItem>? paths,
/// The incoming webhooks that may be received as part of this
/// API and that the API consumer MAY choose to implement.
/// Closely related to the callbacks feature, this section describes
/// requests initiated other than by an API call, for example by an out of
/// band registration. The key name is a unique string to refer to each
/// webhook, while the (optionally referenced) path Item Object describes a
/// request that may be initiated by the API provider and the expected responses.
Map<String, PathItem>? webhooks,
/// An element to hold various schemas for the document.
Components? components,
/// A declaration of which security mechanisms can be used across the API.
/// The list of values includes alternative security requirement objects
/// that can be used. Only one of the security requirement objects need
/// to be satisfied to authorize a request. Individual operations can override
/// this definition. To make security optional, an empty security requirement ({})
/// can be included in the array.
List<Security>? security,
/// A mapping of any extra schemas that this generator created and the parent schema
/// that they were created from. This is used to improve the generated schema library
@Default({}) Map<String, List<String>> extraSchemaMapping,
}) = _OpenApi;