Skip to content

Commit a0f3ca2

Browse files
committed
feat: Changing to a config based approach for obtaining the official openapi generator jar.
1 parent 2ff3b99 commit a0f3ca2

27 files changed

+596
-142
lines changed

.github/workflows/code_quality.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ jobs:
3232
uses: dart-lang/[email protected]
3333
with:
3434
sdk: stable
35+
36+
- name: Install Melos
37+
run: dart pub global activate melos
38+
39+
- name: Bootstrap packages with Melos
40+
run: melos bootstrap
41+
3542
- name: Install Dependencies
3643
run: dart pub get
3744
- name: Build runner

.github/workflows/release_please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010

1111
jobs:
1212
release-please:
13+
if: github.event.pull_request.merged == true && !startsWith(github.event.pull_request.title, 'chore(release):')
1314
runs-on: ubuntu-latest
1415
steps:
1516
- uses: google-github-actions/release-please-action@v3

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ doc/api/
1616
.DS_Store
1717

1818
**/coverage
19+
20+
pubspec_overrides.yaml
21+
!pubspec.lock

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Check out the known issues article here [Known Issues](openapi-generator-annotat
140140

141141
## Contributing
142142

143-
All contributions are welcome. Please ensure to read through our [contributing guidelines](Contributing.md) before
143+
All contributions are welcome. Please ensure to read through our [contributing guidelines](CONTRIBUTING.md) before
144144
sending your PRs.
145145

146146
## Features and bugs

example/lib/main.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Openapi Generator last run: : 2024-01-16T03:54:39.346434
1+
// Openapi Generator last run: : 2024-10-31T23:11:13.130123
22
import 'package:flutter/material.dart';
33
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
44

@@ -8,11 +8,12 @@ void main() {
88

99
@Openapi(
1010
additionalProperties:
11-
DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep..'),
11+
DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep.'),
1212
inputSpec:
1313
RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'),
1414
typeMappings: {'Pet': 'ExamplePet'},
15-
generatorName: Generator.dio,
15+
generatorName: Generator.dioAlt,
16+
updateAnnotatedFile: true,
1617
runSourceGenOnOutput: true,
1718
outputDirectory: 'api/petstore_api',
1819
)
@@ -112,7 +113,7 @@ class _MyHomePageState extends State<MyHomePage> {
112113
),
113114
Text(
114115
'$_counter',
115-
style: Theme.of(context).textTheme.headline4,
116+
style: Theme.of(context).textTheme.bodyMedium,
116117
),
117118
],
118119
),

example/openapi-spec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
openapi: 3.0.1
22
info:
3-
title: OpenAPI Petstore
3+
title: OpenAPI Petstore.
44
description: This is a sample server Petstore server. For this sample, you can use
55
the api key `special-key` to test the authorization filters.
66
license:

example/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
openapi: "3.0.3"
33
info:
4-
title: "OpenAPI definition"
4+
title: "OpenAPI definition."
55
version: "v0.1"
66
paths:
77
/v0.1/transactions:

melos.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: openapi_generator_dart
2+
3+
packages:
4+
- example
5+
- openapi-generator
6+
- openapi-generator-annotations
7+
- openapi-generator-cli

openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class Openapi {
5151
final String? outputDirectory;
5252

5353
/// Defines whether the output directory should be cleaned up before generating the output.
54-
///
54+
///
5555
/// e.g [''], ['lib/src']
56-
final List<dynamic>? cleanSubOutputDirectory;
56+
final List<String>? cleanSubOutputDirectory;
5757

5858
/// Skips the default behavior of validating an input specification.
5959
///

openapi-generator-annotations/pubspec.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ homepage: https://github.com/gibahjoe/openapi-generator-dart
55

66

77
environment:
8-
sdk: '>=2.12.0 <3.0.0'
8+
sdk: '>=2.12.0 <4.0.0'
99

1010
dependencies:
11-
crypto: '>=3.0.0 <4.0.0'
12-
meta: '>=1.3.0 <2.0.0'
1311

1412
dev_dependencies:
1513
test:

0 commit comments

Comments
 (0)