Skip to content

Commit 1314bca

Browse files
committed
1.28.0
1 parent 496b9d2 commit 1314bca

File tree

10 files changed

+135
-218
lines changed

10 files changed

+135
-218
lines changed

swagger_parser/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.28.0
2+
- Fix documentation
3+
- Fix ensure consistent file naming for tags with alphanumeric suffixes
4+
15
## 1.27.0
26
- Allow to filter the generation of endpoints in a client by tags
37
- Allow to define a fallback client for endpoints that do not have a tag - fixes [[#271](https://github.com/Carapacik/swagger_parser/issues/271)]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export 'io_output.dart' if (dart.library.html) 'web_output.dart';
1+
export 'io_output.dart' if (dart.library.js_interop) 'web_output.dart';

swagger_parser/lib/src/utils/output/web_output.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// ignore_for_file: avoid_print
2+
import 'package:args/args.dart';
3+
24
import '../../generator/model/generation_statistic.dart';
35
import '../../parser/swagger_parser_core.dart';
46
import '../base_utils.dart';
@@ -13,6 +15,8 @@ void introMessage() {
1315
''');
1416
}
1517

18+
void printHelpMessage(ArgParser parser) {}
19+
1620
void generateMessage() {
1721
print('Generate...');
1822
}

swagger_parser/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: swagger_parser
22
description: Package that generates REST clients and data classes from OpenApi definition file
3-
version: 1.27.0
3+
version: 1.28.0
44
repository: https://github.com/Carapacik/swagger_parser/tree/main/swagger_parser
55
topics:
66
- swagger

swagger_parser_pages/lib/app.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ class App extends StatelessWidget {
99
title: 'Swagger Parser',
1010
restorationScopeId: 'swagger parser',
1111
debugShowCheckedModeBanner: false,
12-
theme: ThemeData(
13-
colorSchemeSeed: const Color(0xFFD0BCFF),
14-
brightness: Brightness.dark,
15-
),
12+
theme: ThemeData(colorSchemeSeed: const Color(0xFFD0BCFF), brightness: Brightness.dark),
1613
themeMode: ThemeMode.dark,
1714
home: const MainPage(),
1815
);

swagger_parser_pages/lib/content/generator_content.dart

Lines changed: 88 additions & 158 deletions
Large diffs are not rendered by default.

swagger_parser_pages/lib/content/information_box.dart

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,16 @@ class InformationBox extends StatelessWidget {
2020
baseline: TextBaseline.alphabetic,
2121
child: Link(
2222
uri: Uri.parse('https://pub.dev/packages/swagger_parser'),
23-
builder:
24-
(context, followLink) => MouseRegion(
25-
cursor: SystemMouseCursors.click,
26-
child: GestureDetector(
27-
onTap: followLink,
28-
child: const Text(
29-
'swagger_parser',
30-
style: TextStyle(
31-
fontSize: 18,
32-
color: Color(0xFFD0BCFF),
33-
decoration: TextDecoration.underline,
34-
),
35-
),
36-
),
23+
builder: (context, followLink) => MouseRegion(
24+
cursor: SystemMouseCursors.click,
25+
child: GestureDetector(
26+
onTap: followLink,
27+
child: const Text(
28+
'swagger_parser',
29+
style: TextStyle(fontSize: 18, color: Color(0xFFD0BCFF), decoration: TextDecoration.underline),
3730
),
31+
),
32+
),
3833
),
3934
),
4035
const TextSpan(
@@ -70,8 +65,7 @@ class InformationBox extends StatelessWidget {
7065
children: [
7166
TextSpan(
7267
style: const TextStyle(fontSize: 18),
73-
text:
74-
'Paste your JSON file into text box and configure given parameters: \n',
68+
text: 'Paste your JSON file into text box and configure given parameters: \n',
7569
children: [
7670
const WidgetSpan(
7771
alignment: PlaceholderAlignment.aboveBaseline,
@@ -94,8 +88,7 @@ class InformationBox extends StatelessWidget {
9488
child: SizedBox(height: 24),
9589
),
9690
const TextSpan(
97-
text:
98-
'- Language parameter for generated files. Currently support languages are: dart, kotlin.\n',
91+
text: '- Language parameter for generated files. Currently support languages are: dart, kotlin.\n',
9992
style: TextStyle(fontSize: 18),
10093
),
10194
const TextSpan(
@@ -109,37 +102,34 @@ class InformationBox extends StatelessWidget {
109102
child: SizedBox(height: 24),
110103
),
111104
TextSpan(
112-
text:
113-
'- Freezed. Available only for dart. Makes generated DTOs compatible with ',
105+
text: '- Freezed. Available only for dart. Makes generated DTOs compatible with ',
114106
style: const TextStyle(fontSize: 18),
115107
children: [
116108
WidgetSpan(
117109
alignment: PlaceholderAlignment.baseline,
118110
baseline: TextBaseline.alphabetic,
119111
child: Link(
120112
uri: Uri.parse('https://pub.dev/packages/freezed'),
121-
builder:
122-
(context, followLink) => MouseRegion(
123-
cursor: SystemMouseCursors.click,
124-
child: GestureDetector(
125-
onTap: followLink,
126-
child: const Text(
127-
'freezed',
128-
style: TextStyle(
129-
fontSize: 18,
130-
color: Color(0xFFD0BCFF),
131-
decoration: TextDecoration.underline,
132-
),
133-
),
113+
builder: (context, followLink) => MouseRegion(
114+
cursor: SystemMouseCursors.click,
115+
child: GestureDetector(
116+
onTap: followLink,
117+
child: const Text(
118+
'freezed',
119+
style: TextStyle(
120+
fontSize: 18,
121+
color: Color(0xFFD0BCFF),
122+
decoration: TextDecoration.underline,
134123
),
135124
),
125+
),
126+
),
136127
),
137128
),
138129
],
139130
),
140131
const TextSpan(
141-
text:
142-
'\nPress generate and enjoy your Data classes and Rest clients packed into zip archive.',
132+
text: '\nPress generate and enjoy your Data classes and Rest clients packed into zip archive.',
143133
style: TextStyle(fontSize: 18),
144134
),
145135
],

swagger_parser_pages/lib/content/main_page.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ class MainPage extends StatelessWidget {
1717
crossAxisAlignment: CrossAxisAlignment.start,
1818
children: [
1919
SizedBox(height: 16),
20-
Text(
21-
'Swagger parser',
22-
style: TextStyle(fontSize: 40, fontWeight: FontWeight.w800),
23-
),
20+
Text('Swagger parser', style: TextStyle(fontSize: 40, fontWeight: FontWeight.w800)),
2421
SizedBox(height: 8),
2522
Text(
2623
'Paste your OpenApi JSON or YAML file content in the textarea below, '

swagger_parser_pages/lib/utils/file_utils.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,14 @@ void generateArchive(List<GeneratedFile> files) {
1515
archive.addFile(ArchiveFile(file.name, contentBytes.length, contentBytes));
1616
}
1717
final outputStream = OutputMemoryStream();
18-
final bytes = encoder.encode(
19-
archive,
20-
level: DeflateLevel.bestCompression,
21-
output: outputStream,
22-
);
18+
final bytes = encoder.encode(archive, level: DeflateLevel.bestCompression, output: outputStream);
2319

2420
final blobWeb = web.Blob(<JSUint8Array>[Uint8List.fromList(bytes).toJS].toJS);
2521
final url = web.URL.createObjectURL(blobWeb);
26-
final anchor =
27-
web.document.createElement('a') as web.HTMLAnchorElement
28-
..href = url
29-
..style.display = 'none'
30-
..download = 'generated.zip';
22+
final anchor = web.document.createElement('a') as web.HTMLAnchorElement
23+
..href = url
24+
..style.display = 'none'
25+
..download = 'generated.zip';
3126
web.document.body!.children.add(anchor);
3227

3328
// download

swagger_parser_pages/pubspec.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ description: Web interface for swagger_parser
33
publish_to: none
44
version: 1.0.0+1
55
environment:
6-
sdk: '>=3.7.0 <4.0.0'
6+
sdk: '>=3.8.0 <4.0.0'
77

88
dependencies:
9-
archive: ^4.0.4
10-
file_picker: ^9.1.0
9+
archive: ^4.0.7
10+
file_picker: ^10.2.1
1111
flutter:
1212
sdk: flutter
1313
flutter_web_plugins:
1414
sdk: flutter
15-
swagger_parser: ^1.22.0
16-
url_launcher: ^6.3.1
15+
swagger_parser: ^1.28.0
16+
url_launcher: ^6.3.2
1717
web: ^1.1.1
1818

1919
dev_dependencies:

0 commit comments

Comments
 (0)