swagger_to_dart 0.1.1 copy "swagger_to_dart: ^0.1.1" to clipboard
swagger_to_dart: ^0.1.1 copied to clipboard

Convert Swagger to Dart using freezed and retrofit support only 3.1.0 openApi

Swagger to Dart #

  • Add dependencies to pubspec.yaml file: #

dart pub add freezed_annotation
dart pub add dev:build_runner
dart pub add dev:freezed

dart pub add json_annotation
dart pub add dev:json_serializable

dart pub add dio

dart pub add retrofit
dart pub add dev:retrofit_generator


dart pub add dev:swagger_to_dart --path=../
  • For freezed with retrofit use build.yaml file with this content: #

global_options:
  freezed:
    runs_before:
      - json_serializable
  json_serializable:
    runs_before:
      - retrofit_generator
  • Run code generation with build_runner for json_seializable(freezed) and retrofit with command: #

dart run build_runner build
  • Clients and models are generated! #

4
likes
110
points
603
downloads

Publisher

verified publishermatheer.com

Weekly Downloads

Convert Swagger to Dart using freezed and retrofit support only 3.1.0 openApi

Repository (GitHub)
View/report issues

Topics

#swagger #openapi #generator #freezed #retrofit

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

collection, freezed_annotation, json_annotation, logger, path, yaml

More

Packages that depend on swagger_to_dart