openapi_generator_annotations 6.1.0 copy "openapi_generator_annotations: ^6.1.0" to clipboard
openapi_generator_annotations: ^6.1.0 copied to clipboard

Annotation package for openapi_generator https://pub.dev/packages/openapi_generator.

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

license.

Usage #

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

dependencies:
  openapi_generator_annotations: ^2.2.0
copied to clipboard

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

dev_dependencies:
  openapi_generator: ^2.2.0
copied to clipboard

Annotate a dart class with @Openapi() annotation

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

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

flutter pub run build_runner build --delete-conflicting-outputs
copied to clipboard

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

To use the generated api in your project, import it into your pubspec

Give a thumbs up if you like this library

Known Issues #

Check out the known issues article here Known Issues

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Buy Me A Coffee

20
likes
150
points
21k
downloads

Publisher

verified publisherdevappliance.com

Weekly Downloads

2024.09.08 - 2025.03.23

Annotation package for openapi_generator https://pub.dev/packages/openapi_generator.

Repository (GitHub)
Contributing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

crypto, meta

More

Packages that depend on openapi_generator_annotations