From 25f0deabaa36432a82c26f3343e3b8b634a56bb2 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 4 Feb 2023 22:26:14 +0100 Subject: [PATCH] dynamite: Fix objects without properties but with additionalProperties set --- packages/dynamite/lib/src/openapi_builder.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index 8b484da8..c2c04f89 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -1543,6 +1543,13 @@ TypeResult resolveType( break; case 'object': if (schema.properties == null) { + if (schema.additionalProperties ?? false) { + result = TypeResultMap( + 'Map', + TypeResultBase('dynamic'), + ); + break; + } result = TypeResultBase('dynamic'); break; }