Skip to content

Commit

Permalink
fix: nullable when generating non-list objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Jun 8, 2023
1 parent 66cc98a commit 9d093a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/katana_model_openapi/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -361,21 +361,21 @@ packages:
path: "../../katana"
relative: true
source: path
version: "2.0.1"
version: "2.1.0"
katana_model_openapi:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.0.1"
version: "2.0.3"
katana_model_openapi_builder:
dependency: "direct dev"
description:
path: "../../katana_model_openapi_builder"
relative: true
source: path
version: "2.0.1"
version: "2.0.3"
lints:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion packages/katana_model_openapi/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ packages:
path: "../katana"
relative: true
source: path
version: "2.0.1"
version: "2.2.0"
lints:
dependency: transitive
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ extension APISchemaObjectExtensions on APISchemaObject {
return "List<${items?.toDartType(key, inList: true)}>";
default:
if (additionalPropertyPolicy != null) {
return "Map<String,dynamic>";
if (!inList) {
return "Map<String,dynamic>?";
} else {
return "Map<String,dynamic>";
}
}
return "Object$nullable";
}
Expand Down
2 changes: 1 addition & 1 deletion packages/katana_model_openapi_builder/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ packages:
path: "../katana"
relative: true
source: path
version: "2.0.1"
version: "2.2.0"
lints:
dependency: transitive
description:
Expand Down

0 comments on commit 9d093a1

Please sign in to comment.