mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 18:57:05 +08:00
feat: update AuthModel serialization to use explicitToJson for nested objects
This commit is contained in:
@@ -10,6 +10,7 @@ part 'api_auth_model.freezed.dart';
|
||||
|
||||
@freezed
|
||||
class AuthModel with _$AuthModel {
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
const factory AuthModel({
|
||||
required APIAuthType type,
|
||||
AuthApiKeyModel? apikey,
|
||||
|
||||
@@ -226,7 +226,8 @@ class __$$AuthModelImplCopyWithImpl<$Res>
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class _$AuthModelImpl implements _AuthModel {
|
||||
const _$AuthModelImpl(
|
||||
{required this.type, this.apikey, this.bearer, this.basic, this.jwt});
|
||||
|
||||
@@ -26,10 +26,10 @@ _$AuthModelImpl _$$AuthModelImplFromJson(Map<String, dynamic> json) =>
|
||||
Map<String, dynamic> _$$AuthModelImplToJson(_$AuthModelImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'type': _$APIAuthTypeEnumMap[instance.type]!,
|
||||
'apikey': instance.apikey,
|
||||
'bearer': instance.bearer,
|
||||
'basic': instance.basic,
|
||||
'jwt': instance.jwt,
|
||||
'apikey': instance.apikey?.toJson(),
|
||||
'bearer': instance.bearer?.toJson(),
|
||||
'basic': instance.basic?.toJson(),
|
||||
'jwt': instance.jwt?.toJson(),
|
||||
};
|
||||
|
||||
const _$APIAuthTypeEnumMap = {
|
||||
|
||||
Reference in New Issue
Block a user