Skip to content
pubscout

openapi_spec

0.15.0, released a year ago by tazatechnology.com

Generate and parse OpenAPI specifications, producing client, server, and documentation code.

$ flutter pub add openapi_spec
Source repository

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.

  • tonik

    Pure Dart OpenAPI 3.0/3.1 code generator for type-safe API client packages.

  • code_assets

    Provides the hook protocol specification for bundling native code with Dart packages.

  • flutter_gen_runner

    Generates strongly-typed Dart classes for Flutter assets, fonts, and colors to avoid string-based APIs.

Works with

Packages commonly used together with openapi_spec: ones it builds on, ones built on it, and its own family.