Skip to content

Commit d1b9c6c

Browse files
committed
updated annotations and generator to 1.06
1 parent cf8ba5e commit d1b9c6c

File tree

10 files changed

+42
-789
lines changed

10 files changed

+42
-789
lines changed

.idea/libraries/Dart_Packages.xml

Lines changed: 1 addition & 778 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
1-
Generator library for dart/flutter implementation of openapi client code generation.
2-
To be used together with [openapi-generator-annotations](https://pub.dev/packages/openapi_generator_annotations)
1+
This codebase houses the dart/flutter implementations of the openapi client sdk code generation libraries.
2+
3+
With this project, you can generate openapi client sdk libraries for your openapi specification right in your flutter/dart projects. (see example)
34

45
[license](https://github.com/gibahjoe/openapi-generator-dart/blob/master/openapi-generator-annotations/LICENSE).
56

7+
8+
This repo contains the following dart libraries
9+
10+
| Library | Description | latest version |
11+
|---------------|-------------|---------------|
12+
| openapi-generator |Dev dependency for generating openapi sdk via dart source gen [see here for usage](https://pub.dev/packages/openapi_generator)| [![pub package](https://img.shields.io/pub/v/openapi_generator.svg)](https://pub.dev/packages/openapi_generator)|
13+
| openapi-generator-annotations|Annotations for annotating dart class with instructions for generating openapi sdk [see here for usage](https://pub.dev/packages/openapi_generator_annotations)|[![pub package](https://img.shields.io/pub/v/openapi_generator_annotations.svg)](https://pub.dev/packages/openapi_generator)|
14+
| openapi-generator-cli |Cli code openapi sdk generator for dart [see here for usage](https://pub.dev/packages/openapi_generator_cli)|[![pub package](https://img.shields.io/pub/v/openapi_generator_cli.svg)](https://pub.dev/packages/openapi_generator_cli)|
15+
16+
17+
18+
619
## Usage
720

821
Include [openapi-generator-annotations](https://pub.dev/packages/openapi_generator_annotations) as a dependency in the dependencies section of your pubspec.yaml file :
922

1023
```yaml
1124
dependencies:
12-
openapi_generator_annotations: ^1.0.5
25+
openapi_generator_annotations: ^[latest-version]
1326
```
1427
1528
1629
Add [openapi-generator](https://pub.dev/packages/openapi_generator) in the dev dependencies section of your pubspec.yaml file:
1730
1831
```yaml
1932
dev_dependencies:
20-
openapi_generator: ^1.0.5
33+
openapi_generator: ^[latest version]
2134
```
2235
2336
@@ -28,7 +41,7 @@ Annotate a dart class with @Openapi() annotation
2841
additionalProperties:
2942
AdditionalProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep'),
3043
inputSpecFile: 'example/openapi-spec.yaml',
31-
generatorName: 'dart-jaguar',
44+
generatorName: 'dart',
3245
outputDirectory: 'api/petstore_api')
3346
class Example extends OpenapiGeneratorConfig {}
3447
```

openapi-generator-annotations/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.6
2+
3+
- Added support for specifying template directory using -t
4+
15
## 1.0.5
26

37
- Improved support for dart-jaguar

openapi-generator-annotations/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
[![pub package](https://img.shields.io/pub/v/openapi_generator_annotations.svg)](https://pub.dev/packages/openapi_generator)
33

44

5-
Annotation library for dart/flutter implementation of openapi client code generation.
5+
This library is the dart/flutter implementation of openapi client sdk code generation.
6+
7+
With this library, you can generate openapi client sdk libraries from your openapi specification right in your flutter/dart projects. (see example)
8+
69
To be used together with [openapi-generator](https://pub.dev/packages/openapi_generator)
710

811
[license](https://github.com/gibahjoe/openapi-generator-dart/blob/master/openapi-generator-annotations/LICENSE).

openapi-generator-annotations/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: openapi_generator_annotations
22
description: Annotation package for openapi_generator https://pub.dev/packages/openapi_generator.
3-
version: 1.0.5
3+
version: 1.0.6
44
homepage: https://github.com/gibahjoe/openapi-generator-dart
55

66

openapi-generator-cli/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![pub package](https://img.shields.io/pub/v/openapi_generator_cli.svg)](https://pub.dev/packages/openapi_generator_cli)
2+
13
CLI generator wrapper for dart/flutter implementation of openapi client code generation.
24

35
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs,

openapi-generator/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.6
2+
3+
- added support for -t (templateDir)
4+
- minor bug fix
5+
16
## 1.0.5
27

38
- Updated generator version to 4.3.0

openapi-generator/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
[![pub package](https://img.shields.io/pub/v/openapi_generator.svg)](https://pub.dev/packages/openapi_generator)
44

5-
Generator library for dart/flutter implementation of openapi client code generation.
5+
This library is the dart/flutter implementation of openapi client sdk code generation.
6+
7+
With this library, you can generate openapi client sdk libraries from your openapi specification right in your flutter/dart projects. (see example)
8+
69
To be used together with [openapi-generator-annotations](https://pub.dev/packages/openapi_generator_annotations)
710

811

openapi-generator/lib/src/openapi_generator_runner.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class OpenapiGenerator extends GeneratorForAnnotation<Openapi> {
3939
}
4040

4141
var templateDir = annotation.read('templateDir')?.stringValue ?? '';
42-
if (inputFile.isNotEmpty) {
42+
if (templateDir.isNotEmpty) {
4343
command = '$command$separator-t$separator${templateDir}';
4444
}
4545

@@ -70,7 +70,7 @@ class OpenapiGenerator extends GeneratorForAnnotation<Openapi> {
7070
var filePath = path.join(outputDirectory, 'lib/api.dart');
7171
if (!alwaysRun && await File(filePath).exists()) {
7272
print(
73-
'openapigenerator skipped because alwaysRun is set to [true] and $filePath already exists');
73+
'openapigenerator skipped because alwaysRun is set to [$alwaysRun] and $filePath already exists');
7474
return '';
7575
}
7676
}

openapi-generator/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: openapi_generator
22
description: Generator for openapi client sdk inspired by the npm impplementation of openapi-generator-cli.
3-
version: 1.0.5
3+
version: 1.0.6
44
homepage: https://github.com/gibahjoe/openapi-generator-dart
55

66
environment:

0 commit comments

Comments
 (0)