diff --git a/packages/dynamite/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/dynamite/lib/src/openapi_builder.dart index d4648b2c..6c8f95ed 100644 --- a/packages/dynamite/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/dynamite/lib/src/openapi_builder.dart @@ -1587,52 +1587,47 @@ TypeResult resolveType( } case 'object': if (schema.properties == null) { - if (schema.additionalProperties != null) { - if (schema.additionalProperties is EmptySchema) { - result = TypeResultMap( - 'BuiltMap', - TypeResultBase('JsonObject'), - nullable: nullable, - ); - } else { - final subResult = resolveType( - spec, - variablePrefix, - state, - identifier, - schema.additionalProperties!, - ); - result = TypeResultMap( - 'BuiltMap', - subResult, - nullable: nullable, - ); - } - break; + if (schema.additionalProperties == null) { + result = TypeResultBase( + 'JsonObject', + nullable: nullable, + ); + } else if (schema.additionalProperties is EmptySchema) { + result = TypeResultMap( + 'BuiltMap', + TypeResultBase('JsonObject'), + nullable: nullable, + ); + } else { + final subResult = resolveType( + spec, + variablePrefix, + state, + identifier, + schema.additionalProperties!, + ); + result = TypeResultMap( + 'BuiltMap', + subResult, + nullable: nullable, + ); } - result = TypeResultBase( - 'JsonObject', - nullable: nullable, - ); - break; - } - if (schema.properties!.isEmpty) { + } else if (schema.properties!.isEmpty) { result = TypeResultMap( 'BuiltMap', TypeResultBase('JsonObject'), nullable: nullable, ); - break; + } else { + result = resolveObject( + spec, + variablePrefix, + state, + identifier, + schema, + nullable: nullable, + ); } - - result = resolveObject( - spec, - variablePrefix, - state, - identifier, - schema, - nullable: nullable, - ); } }