Skip to content

Commit

Permalink
1.17.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Carapacik committed Apr 1, 2024
1 parent bb9eae1 commit eec88c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions swagger_parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.17.2

- Add `MappableField` to dart_mappable template

## 1.17.1

- Fixed error with nullable in multipart ([#211](https://github.com/Carapacik/swagger_parser/issues/211))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ String _toParameter(UniversalRequestType parameter) {
// https://github.com/trevorwang/retrofit.dart/issues/661
// The Word `value` cant be used a a keyword argument
final keywordArguments =
parameter.type.name!.toCamel.replaceFirst("value", "value_");
parameter.type.name!.toCamel.replaceFirst('value', 'value_');

return " @${parameter.parameterType.type}(${parameter.name != null && !parameter.parameterType.isBody ? "${parameter.parameterType.isPart ? 'name: ' : ''}'${parameter.name}'" : ''}) "
'${_required(parameter.type)}'
Expand Down
5 changes: 2 additions & 3 deletions swagger_parser/lib/src/parser/parser/open_api_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,8 @@ class OpenApiParser {
(e.value as Map<String, dynamic>)[_nullableConst] == true;
final typeWithImport = _findType(
e.value as Map<String, dynamic>,
isRequired: isNullable
? false
: (isRequiredFromRequestBody || config.requiredByDefault),
isRequired: !isNullable &&
(isRequiredFromRequestBody || config.requiredByDefault),
// isRequired: isRequiredFromRequestBody || config.requiredByDefault,
);
final currentType = typeWithImport.type;
Expand Down
2 changes: 1 addition & 1 deletion swagger_parser/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: swagger_parser
description: Package that generates REST clients and data classes from OpenApi definition file
version: 1.17.1
version: 1.17.2
repository: https://github.com/Carapacik/swagger_parser/tree/main/swagger_parser
homepage: https://omega-r.com
topics:
Expand Down

0 comments on commit eec88c7

Please sign in to comment.