Search packages, repositories and app categories

Package detailsv2.0.1

swagger_parser

Package that generates REST clients and data classes from OpenApi definition file

AndroidiOSmacOSWindowsLinux
30-day downloads
108K
Likes
124
Pub points
160

Install package

flutter pub add swagger_parser

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter/Dart package that automatically generates REST clients and data classes from OpenAPI specification files. It simplifies API integration by parsing OpenAPI (formerly Swagger) definitions into type-safe Dart code, reducing boilerplate and improving development speed. Ideal for teams using standardized API contracts, it supports multiple platforms including Android, iOS, macOS, Windows, and Linux. The generated code ensures consistency between API documentation and client implementation.

Use cases

  • Automating API client generation
  • Synchronizing client code with OpenAPI specs
  • Reducing manual JSON serialization
  • Enabling rapid prototyping with APIs
  • Maintaining consistent data models across platforms

Key features

  • Generates data classes from OpenAPI schemas
  • Creates REST client interfaces
  • Supports full OpenAPI specification
  • Produces type-safe Dart code
  • Integrates with CI/CD pipelines

Suitable for

  • Teams using OpenAPI specifications
  • Projects requiring automated API client generation
  • Developers seeking reduced boilerplate
  • Cross-platform mobile and desktop apps
  • API-first development workflows

Considerations

  • Requires valid OpenAPI 3.x specification
  • Manual adjustments may be needed for complex schemas
  • Generated code should be version-controlled
  • Not suitable for dynamic or non-standard APIs
  • Best used in conjunction with API documentation workflows

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Swagger Parser

pub version pub likes dart style Star on Github Last commit on Github Tests

Swagger Parser is a Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.

  • Supports OpenApi v2, v3.0 and v3.1
  • Can generate files from JSON and YAML format
  • Generation by definition link or from file
  • Support for multiple definitions
  • Supports Dart and Kotlin

We also have a web interface so you can try out swagger parser: https://carapacik.github.io/swagger_parser

Categories

Dependencies

Dependency list 7 items

Source repository

Projects using this package

No data available yet.