From 16eb212e0876ab324e7ae2c58b045fcabd2d9365 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Fri, 27 Oct 2023 18:42:24 +0200 Subject: [PATCH] refactor(dynamite): remove unused typedef generation Signed-off-by: Nikolas Rimikis --- .../lib/src/builder/generate_schemas.dart | 29 +++++-------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/packages/dynamite/dynamite/lib/src/builder/generate_schemas.dart b/packages/dynamite/dynamite/lib/src/builder/generate_schemas.dart index 29294b18..17a6c46f 100644 --- a/packages/dynamite/dynamite/lib/src/builder/generate_schemas.dart +++ b/packages/dynamite/dynamite/lib/src/builder/generate_schemas.dart @@ -3,7 +3,6 @@ import 'package:dynamite/src/builder/resolve_type.dart'; import 'package:dynamite/src/builder/state.dart'; import 'package:dynamite/src/helpers/dart_helpers.dart'; import 'package:dynamite/src/models/openapi.dart' as openapi; -import 'package:dynamite/src/models/type_result.dart'; Iterable generateSchemas( final openapi.OpenAPI spec, @@ -12,27 +11,13 @@ Iterable generateSchemas( if (spec.components?.schemas != null) { for (final schema in spec.components!.schemas!.entries) { final identifier = toDartName(schema.key, uppercaseFirstCharacter: true); - if (schema.value.type == null && schema.value.ref == null && schema.value.ofs == null) { - yield TypeDef( - (final b) => b - ..name = identifier - ..definition = refer('dynamic'), - ); - } else { - final result = resolveType( - spec, - state, - identifier, - schema.value, - ); - if (result is TypeResultBase) { - yield TypeDef( - (final b) => b - ..name = identifier - ..definition = refer(result.name), - ); - } - } + + resolveType( + spec, + state, + identifier, + schema.value, + ); } }