openapi_spec
0.15.0, released a year ago by tazatechnology.com
Generate and parse OpenAPI specifications, producing client, server, and documentation code.
What it does
The package can read an OpenAPI spec into a Dart object and generate a full client or server library from it. It also supports generating Swagger UI static docs.
AI-written summary of version 0.15.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to generate a Dart client or server from an OpenAPI spec
- You want to parse an existing spec into Dart objects for manipulation
- You need to produce Swagger UI static files
Skip it when
- You only need a lightweight HTTP client without code generation
- You are targeting a language other than Dart
Strengths
- Actively maintained, latest Dart SDK 3.8
- Supports OpenAPI 3.1 and nullable types
- Generates both client and server code, plus Swagger UI
Weaknesses
- Requires Dart 3.8, limiting older projects
- No support for non-Dart code generation
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 12
Alternatives
Packages that do the same job and could replace openapi_spec.
- pigeon
Type-safe code generator for communication between Flutter and host platforms.
90Compare - tonik
Pure Dart OpenAPI 3.0/3.1 code generator for type-safe API client packages.
74Compare - code_assets
Provides the hook protocol specification for bundling native code with Dart packages.
88Compare - flutter_gen_runner
Generates strongly-typed Dart classes for Flutter assets, fonts, and colors to avoid string-based APIs.
87Compare
Works with
Packages commonly used together with openapi_spec: ones it builds on, ones built on it, and its own family.
- yamlopenapi_spec depends on itA Dart library for parsing YAML documents into Dart data structures.
- json_annotationopenapi_spec depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- argsopenapi_spec depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- intlopenapi_spec depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- freezed_annotationopenapi_spec depends on itAnnotations for the freezed code-generator.
- recaseopenapi_spec depends on itChanges the case of input text to various conventions.
- pub_updateropenapi_spec depends on itChecks if a pub package is up to date and can trigger updates
- mason_loggeropenapi_spec depends on itA lightweight CLI logger with prompts, progress, and custom styling.