OpenAPI constructor
- @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
- required String openapi,
- Info? info,
- @Default.new([]) List<
Server> servers, - @Default.new({}) Map<
String, PathItem> paths, - Components? components,
- @Default.new([]) List<
SecurityRequirement> security, - @Default.new([]) List<
Tag> tags, - ExternalDocs? externalDocs,
- @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({
/// The version of the OpenAPI specification.
/// A semver string which MUST begin with 3.0.
required String openapi,
/// Metadata about the API.
Info? info,
/// An array of Server Objects, which provide connectivity information
/// to a target server.
@Default([]) List<Server> servers,
/// The available paths and their operations.
@Default({}) Map<String, PathItem> paths,
/// An element to hold reusable objects for the specification.
Components? components,
/// A declaration of which security schemes are required for the entire API.
@Default([]) List<SecurityRequirement> security,
/// A list of tags for API documentation.
@Default([]) List<Tag> tags,
/// Additional external documentation for the API.
ExternalDocs? externalDocs,
/// Vendor extensions (keys like `x-*`).
@JsonKey(includeIfNull: false, includeFromJson: false, includeToJson: false)
Map<String, dynamic>? extensions,
}) = _OpenAPI;