openapi_generator 1.1.1

Dart native js
Flutter Android iOS web

Generator for openapi client sdk inspired by the npm impplementation of openapi-generator-cli.

pub package

This library is the dart/flutter implementation of openapi client sdk code generation.

With this library, you can generate openapi client sdk libraries from your openapi specification right in your flutter/dart projects. (see example)

To be used together with openapi-generator-annotations

Usage #

Include openapi-generator-annotations as a dependency in the dependencies section of your pubspec.yaml file :

dependencies:
  openapi_generator_annotations: ^1.0.8

Add openapi-generator in the dev dependencies section of your pubspec.yaml file:

dev_dependencies:
  openapi_generator: ^1.1.0

Annotate a dart class with @Openapi() annotation

@Openapi(
    additionalProperties:
    AdditionalProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep'),
    inputSpecFile: 'example/openapi-spec.yaml',
    generatorName: Generator.DART2_API,
    outputDirectory: 'api/petstore_api')
class Example extends OpenapiGeneratorConfig {}

Run command below to generate open api client sdk from spec file specified in annotation.

flutter pub run build_runner build --delete-conflicting-outputs

The api sdk will be generated in the folder specified in the annotation. See examples for more details

Features and bugs #

Please file feature requests and bugs at the issue tracker.

5
likes
100
pub points
65%
popularity

Generator for openapi client sdk inspired by the npm impplementation of openapi-generator-cli.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

gibahjoe@gmail.com

License

BSD (LICENSE)

Dependencies

analyzer, build, generic_reader, openapi_generator_annotations, openapi_generator_cli, path, source_gen

More

Packages that depend on openapi_generator