diff --git a/swagger_parser/CHANGELOG.md b/swagger_parser/CHANGELOG.md index 3c5a6779..dedee9c4 100644 --- a/swagger_parser/CHANGELOG.md +++ b/swagger_parser/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.21.0 +- Add support for union types `oneOf`([#265](https://github.com/Carapacik/swagger_parser/issues/265), [#286](https://github.com/Carapacik/swagger_parser/issues/265)) +- Fixed config property inheritance + ## 1.20.1 - Fixed errors with config parsing diff --git a/swagger_parser/pubspec.yaml b/swagger_parser/pubspec.yaml index fb690451..2ef66cfd 100644 --- a/swagger_parser/pubspec.yaml +++ b/swagger_parser/pubspec.yaml @@ -1,6 +1,6 @@ name: swagger_parser description: Package that generates REST clients and data classes from OpenApi definition file -version: 1.20.1 +version: 1.21.0 repository: https://github.com/Carapacik/swagger_parser/tree/main/swagger_parser topics: - swagger diff --git a/swagger_parser_pages/lib/content/generator_content.dart b/swagger_parser_pages/lib/content/generator_content.dart index f1cae7df..db2db485 100644 --- a/swagger_parser_pages/lib/content/generator_content.dart +++ b/swagger_parser_pages/lib/content/generator_content.dart @@ -90,8 +90,7 @@ class _GeneratorContentState extends State { height: 48, child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFFc92b16) - .withOpacity(0.8), + backgroundColor: const Color(0xb3c92b16), ), onPressed: () async { _fileContent.clear(); diff --git a/swagger_parser_pages/lib/utils/file_utils.dart b/swagger_parser_pages/lib/utils/file_utils.dart index 1899a25a..6f08bea1 100644 --- a/swagger_parser_pages/lib/utils/file_utils.dart +++ b/swagger_parser_pages/lib/utils/file_utils.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:js_interop'; import 'dart:js_interop_unsafe'; import 'dart:typed_data'; @@ -10,19 +11,17 @@ void generateArchive(List files) { final encoder = ZipEncoder(); final archive = Archive(); for (final file in files) { - archive.addFile(ArchiveFile(file.name, file.content.length, file.content)); + final contentBytes = utf8.encode(file.content); + archive.addFile(ArchiveFile(file.name, contentBytes.length, contentBytes)); } - final outputStream = OutputStream(); + final outputStream = OutputMemoryStream(); final bytes = encoder.encode( archive, - level: Deflate.BEST_COMPRESSION, + level: DeflateLevel.bestCompression, output: outputStream, ); - if (bytes == null || bytes is! Uint8List) { - throw Exception('Error with encode'); - } - final blobWeb = web.Blob([bytes.toJS].toJS); + final blobWeb = web.Blob([Uint8List.fromList(bytes).toJS].toJS); final url = web.URL.createObjectURL(blobWeb); final anchor = web.document.createElement('a') as web.HTMLAnchorElement ..href = url diff --git a/swagger_parser_pages/pubspec.yaml b/swagger_parser_pages/pubspec.yaml index c7b7f29b..a77aea4a 100644 --- a/swagger_parser_pages/pubspec.yaml +++ b/swagger_parser_pages/pubspec.yaml @@ -3,21 +3,21 @@ description: Web interface for swagger_parser publish_to: none version: 1.0.0+1 environment: - sdk: '>=3.5.0 <4.0.0' + sdk: '>=3.6.0 <4.0.0' dependencies: - archive: ^3.6.1 - file_picker: ^8.0.7 + archive: ^4.0.2 + file_picker: ^8.1.7 flutter: sdk: flutter flutter_web_plugins: sdk: flutter - swagger_parser: ^1.18.1 - url_launcher: ^6.3.0 + swagger_parser: ^1.21.0 + url_launcher: ^6.3.1 web: dev_dependencies: - carapacik_lints: ^1.9.1 + carapacik_lints: ^1.10.0 flutter: uses-material-design: true