pub.dev NuGet v1.0.0 MIT
OpenAPI to Dart Dio Client Generator
metaengine_openapi_dart_dioConvert OpenAPI 3.x to typed Dart API clients and models that use Dio. Generate locally from a JSON or YAML file or an HTTP(S) URL, with configurable Dio timeouts and native HTTP QUERY for OpenAPI 3.2 query operations.
Install
Pick your registry
pub.devPrimarymetaengine_openapi_dart_dio
$dart pub global activate metaengine_openapi_dart_dio
v1.0.0
NuGetMetaEngine.Dart.OpenApi.Dio
$dotnet add package MetaEngine.Dart.OpenApi.Dio
v1.0.0
Usage
Drive it from the CLI or programmatically
pub.dev distributes the generator as a command-line tool. NuGet provides the C# fluent API for .NET projects.
pub.dev · Dart CLI
After install, point the CLI at your schema. It writes the generated tree to your chosen output directory.
Basic syntax
metaengine_openapi_dart_dio <input> <output> [flags]Pass a local JSON or YAML file or an HTTP(S) URL. The generator supports macOS arm64 and x64, Linux arm64 and x64, and Windows x64. Add the Pub cache bin directory to your PATH. The first run downloads and verifies the runner for your platform.
Quick examples
Generate from a local file with a receive timeout
metaengine_openapi_dart_dio api.yaml ./lib/generated --receive-timeout 1500Generate from a URL
metaengine_openapi_dart_dio https://api.example.com/openapi.json ./lib/generatedAdd Dio to the project that uses the generated client
dart pub add dioCLI options
Option
Description
--connect-timeout <ms>
Override the Dio connect timeout in milliseconds
--receive-timeout <ms>
Override the Dio receive timeout in milliseconds
--send-timeout <ms>
Override the Dio send timeout in milliseconds
--help
List all generation options
Features
Why this package is different
Typed Dart clients
Generate Dart API clients and models from an OpenAPI schema.
Configurable Dio timeouts
Set connect, receive, and send timeouts in milliseconds.
Local generation
Run the generator on macOS, Linux, or Windows and write the Dart source into your project.