|
|
@ -65,6 +65,7 @@ class OpenAPIBuilder implements Builder { |
|
|
|
'', |
|
|
|
'', |
|
|
|
"import 'package:built_collection/built_collection.dart';", |
|
|
|
"import 'package:built_collection/built_collection.dart';", |
|
|
|
"import 'package:built_value/built_value.dart';", |
|
|
|
"import 'package:built_value/built_value.dart';", |
|
|
|
|
|
|
|
"import 'package:built_value/json_object.dart';", |
|
|
|
"import 'package:built_value/serializer.dart';", |
|
|
|
"import 'package:built_value/serializer.dart';", |
|
|
|
"import 'package:built_value/standard_json_plugin.dart';", |
|
|
|
"import 'package:built_value/standard_json_plugin.dart';", |
|
|
|
"import 'package:cookie_jar/cookie_jar.dart';", |
|
|
|
"import 'package:cookie_jar/cookie_jar.dart';", |
|
|
@ -1520,7 +1521,7 @@ TypeResult resolveType( |
|
|
|
}) { |
|
|
|
}) { |
|
|
|
TypeResult? result; |
|
|
|
TypeResult? result; |
|
|
|
if (schema.ref == null && schema.ofs == null && schema.type == null) { |
|
|
|
if (schema.ref == null && schema.ofs == null && schema.type == null) { |
|
|
|
return TypeResultBase('dynamic'); |
|
|
|
return TypeResultBase('JsonObject'); |
|
|
|
} |
|
|
|
} |
|
|
|
if (schema.ref != null) { |
|
|
|
if (schema.ref != null) { |
|
|
|
final name = schema.ref!.split('/').last; |
|
|
|
final name = schema.ref!.split('/').last; |
|
|
@ -1759,14 +1760,14 @@ TypeResult resolveType( |
|
|
|
extraJsonSerializableValues: extraJsonSerializableValues, |
|
|
|
extraJsonSerializableValues: extraJsonSerializableValues, |
|
|
|
); |
|
|
|
); |
|
|
|
result = TypeResultList( |
|
|
|
result = TypeResultList( |
|
|
|
'List<${subResult.name}>', |
|
|
|
'BuiltList<${subResult.name}>', |
|
|
|
subResult, |
|
|
|
subResult, |
|
|
|
fromContentString: fromContentString, |
|
|
|
fromContentString: fromContentString, |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
result = TypeResultList( |
|
|
|
result = TypeResultList( |
|
|
|
'List', |
|
|
|
'BuiltList<JsonObject>', |
|
|
|
TypeResultBase('dynamic'), |
|
|
|
TypeResultBase('JsonObject'), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1775,8 +1776,8 @@ TypeResult resolveType( |
|
|
|
if (schema.additionalProperties != null) { |
|
|
|
if (schema.additionalProperties != null) { |
|
|
|
if (schema.additionalProperties is EmptySchema) { |
|
|
|
if (schema.additionalProperties is EmptySchema) { |
|
|
|
result = TypeResultMap( |
|
|
|
result = TypeResultMap( |
|
|
|
'Map<String, dynamic>', |
|
|
|
'BuiltMap<String, Object?>', |
|
|
|
TypeResultBase('dynamic'), |
|
|
|
TypeResultBase('JsonObject'), |
|
|
|
); |
|
|
|
); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
final subResult = resolveType( |
|
|
|
final subResult = resolveType( |
|
|
@ -1787,19 +1788,19 @@ TypeResult resolveType( |
|
|
|
extraJsonSerializableValues: extraJsonSerializableValues, |
|
|
|
extraJsonSerializableValues: extraJsonSerializableValues, |
|
|
|
); |
|
|
|
); |
|
|
|
result = TypeResultMap( |
|
|
|
result = TypeResultMap( |
|
|
|
'Map<String, ${subResult.name}>', |
|
|
|
'BuiltMap<String, ${subResult.name}>', |
|
|
|
TypeResultBase('dynamic'), |
|
|
|
TypeResultBase('JsonObject'), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
result = TypeResultBase('dynamic'); |
|
|
|
result = TypeResultBase('JsonObject'); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (schema.properties!.isEmpty) { |
|
|
|
if (schema.properties!.isEmpty) { |
|
|
|
result = TypeResultMap( |
|
|
|
result = TypeResultMap( |
|
|
|
'Map<String, dynamic>', |
|
|
|
'BuiltMap<String, Object?>', |
|
|
|
TypeResultBase('dynamic'), |
|
|
|
TypeResultBase('JsonObject'), |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|