From 1a78d05c3c2fa7e32491f2767b0609b6a3cf8cd8 Mon Sep 17 00:00:00 2001 From: Roman Laptev Date: Mon, 14 Oct 2024 23:34:55 +0300 Subject: [PATCH] 1.19.2 --- swagger_parser/CHANGELOG.md | 6 +++- .../parser/model/universal_collections.dart | 31 +++++++++---------- swagger_parser/pubspec.yaml | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/swagger_parser/CHANGELOG.md b/swagger_parser/CHANGELOG.md index 859e7f4b..681932cd 100644 --- a/swagger_parser/CHANGELOG.md +++ b/swagger_parser/CHANGELOG.md @@ -1,5 +1,9 @@ +## 1.19.2 +- Fix replacement rules for OpenAPI v2([#266](https://github.com/Carapacik/swagger_parser/issues/266)) +- Add `x-nullable` field for null definition in OpenAPI v2([#268](https://github.com/Carapacik/swagger_parser/issues/268)) + ## 1.19.1 -- Fix generation with `anyOf`, `oneOf` and `allOf` properties +- Fix generation with `anyOf`, `oneOf` and `allOf` properties([#260](https://github.com/Carapacik/swagger_parser/issues/260)) ## 1.19.0 - Add version getter to root client: diff --git a/swagger_parser/lib/src/parser/model/universal_collections.dart b/swagger_parser/lib/src/parser/model/universal_collections.dart index 8cf99fea..e6513419 100644 --- a/swagger_parser/lib/src/parser/model/universal_collections.dart +++ b/swagger_parser/lib/src/parser/model/universal_collections.dart @@ -16,21 +16,20 @@ enum UniversalCollections { const UniversalCollections(); /// Returns String representation of collection - String get collectionsString { - return switch (this) { - UniversalCollections.list || UniversalCollections.nullableList => 'List<', - UniversalCollections.map || - UniversalCollections.nullableMap => - 'Map switch (this) { + UniversalCollections.list || + UniversalCollections.nullableList => + 'List<', + UniversalCollections.map || + UniversalCollections.nullableMap => + 'Map - '?', - UniversalCollections.list || UniversalCollections.map => '' - }; - } + /// Returns question mark for collection + String get questionMark => switch (this) { + UniversalCollections.nullableList || + UniversalCollections.nullableMap => + '?', + UniversalCollections.list || UniversalCollections.map => '' + }; } diff --git a/swagger_parser/pubspec.yaml b/swagger_parser/pubspec.yaml index 69874242..6e2ac8d6 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.19.1 +version: 1.19.2 repository: https://github.com/Carapacik/swagger_parser/tree/main/swagger_parser topics: - swagger