mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 11:27:50 +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
|
@freezed
|
||||||
class AuthModel with _$AuthModel {
|
class AuthModel with _$AuthModel {
|
||||||
|
@JsonSerializable(explicitToJson: true)
|
||||||
const factory AuthModel({
|
const factory AuthModel({
|
||||||
required APIAuthType type,
|
required APIAuthType type,
|
||||||
AuthApiKeyModel? apikey,
|
AuthApiKeyModel? apikey,
|
||||||
|
|||||||
@@ -226,7 +226,8 @@ class __$$AuthModelImplCopyWithImpl<$Res>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@JsonSerializable()
|
|
||||||
|
@JsonSerializable(explicitToJson: true)
|
||||||
class _$AuthModelImpl implements _AuthModel {
|
class _$AuthModelImpl implements _AuthModel {
|
||||||
const _$AuthModelImpl(
|
const _$AuthModelImpl(
|
||||||
{required this.type, this.apikey, this.bearer, this.basic, this.jwt});
|
{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) =>
|
Map<String, dynamic> _$$AuthModelImplToJson(_$AuthModelImpl instance) =>
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'type': _$APIAuthTypeEnumMap[instance.type]!,
|
'type': _$APIAuthTypeEnumMap[instance.type]!,
|
||||||
'apikey': instance.apikey,
|
'apikey': instance.apikey?.toJson(),
|
||||||
'bearer': instance.bearer,
|
'bearer': instance.bearer?.toJson(),
|
||||||
'basic': instance.basic,
|
'basic': instance.basic?.toJson(),
|
||||||
'jwt': instance.jwt,
|
'jwt': instance.jwt?.toJson(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const _$APIAuthTypeEnumMap = {
|
const _$APIAuthTypeEnumMap = {
|
||||||
|
|||||||
Reference in New Issue
Block a user