Skip to content

Commit

Permalink
fix: return empty Map when schema properties is null (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonft authored Dec 4, 2024
1 parent b8e8d3f commit 35868ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions swagger_parser/lib/src/parser/parser/open_api_parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,12 @@ class OpenApiParser {
requiredParameters =
required?.map((e) => e.toString()).toList() ?? [];
} else {
properties =
schemaContent[_propertiesConst] as Map<String, dynamic>;
if (schemaContent[_propertiesConst] is Map<String, dynamic>) {
properties =
schemaContent[_propertiesConst] as Map<String, dynamic>;
} else {
properties = {};
}
requiredParameters =
(schemaContent[_requiredConst] as List<dynamic>?)
?.map((e) => e.toString())
Expand Down

0 comments on commit 35868ea

Please sign in to comment.