Skip to content

Commit

Permalink
fix lints on toJson
Browse files Browse the repository at this point in the history
  • Loading branch information
dickermoshe committed Mar 12, 2024
1 parent 02b092a commit ad5710b
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 4 deletions.
43 changes: 39 additions & 4 deletions lib/src/open_api/index.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11297,6 +11297,10 @@ abstract class _SchemaMap extends Schema {
throw _privateConstructorUsedError;
}

Security _$SecurityFromJson(Map<String, dynamic> json) {
return _Security.fromJson(json);
}

/// @nodoc
mixin _$Security {
/// Each name must correspond to a security scheme which is declared
Expand All @@ -11322,7 +11326,7 @@ mixin _$Security {
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$SecurityCopyWith<Security> get copyWith =>
throw _privateConstructorUsedError;
Expand Down Expand Up @@ -11404,12 +11408,15 @@ class __$$SecurityImplCopyWithImpl<$Res>
}

/// @nodoc
@JsonSerializable()
class _$SecurityImpl extends _Security {
const _$SecurityImpl({this.name, final List<String> scopes = const []})
: _scopes = scopes,
super._();

factory _$SecurityImpl.fromJson(Map<String, dynamic> json) =>
_$$SecurityImplFromJson(json);

/// Each name must correspond to a security scheme which is declared
/// in the [Components.securitySchemes] list
@override
Expand Down Expand Up @@ -11441,6 +11448,7 @@ class _$SecurityImpl extends _Security {
const DeepCollectionEquality().equals(other._scopes, _scopes));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, name, const DeepCollectionEquality().hash(_scopes));
Expand Down Expand Up @@ -11478,13 +11486,23 @@ class _$SecurityImpl extends _Security {
}
return orElse();
}

@override
Map<String, dynamic> toJson() {
return _$$SecurityImplToJson(
this,
);
}
}

abstract class _Security extends Security {
const factory _Security({final String? name, final List<String> scopes}) =
_$SecurityImpl;
const _Security._() : super._();

factory _Security.fromJson(Map<String, dynamic> json) =
_$SecurityImpl.fromJson;

@override

/// Each name must correspond to a security scheme which is declared
Expand Down Expand Up @@ -12953,6 +12971,10 @@ abstract class _ServerVariable implements ServerVariable {
throw _privateConstructorUsedError;
}

OpenApi _$OpenApiFromJson(Map<String, dynamic> json) {
return _OpenApi.fromJson(json);
}

/// @nodoc
mixin _$OpenApi {
/// This string must be the version number of the
Expand Down Expand Up @@ -13026,7 +13048,7 @@ mixin _$OpenApi {
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$OpenApiCopyWith<OpenApi> get copyWith => throw _privateConstructorUsedError;
}
Expand Down Expand Up @@ -13261,7 +13283,7 @@ class __$$OpenApiImplCopyWithImpl<$Res>
}

/// @nodoc
@JsonSerializable()
class _$OpenApiImpl extends _OpenApi {
const _$OpenApiImpl(
{@JsonKey(name: 'openapi') this.version = '3.0.3',
Expand All @@ -13283,6 +13305,9 @@ class _$OpenApiImpl extends _OpenApi {
_extraSchemaMapping = extraSchemaMapping,
super._();

factory _$OpenApiImpl.fromJson(Map<String, dynamic> json) =>
_$$OpenApiImplFromJson(json);

/// This string must be the version number of the
/// OpenAPI Specification that the OpenAPI document uses.
/// This is not related to the API [Info.version] string.
Expand Down Expand Up @@ -13443,6 +13468,7 @@ class _$OpenApiImpl extends _OpenApi {
.equals(other._extraSchemaMapping, _extraSchemaMapping));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType,
Expand Down Expand Up @@ -13491,6 +13517,13 @@ class _$OpenApiImpl extends _OpenApi {
}
return orElse();
}

@override
Map<String, dynamic> toJson() {
return _$$OpenApiImplToJson(
this,
);
}
}

abstract class _OpenApi extends OpenApi {
Expand All @@ -13508,6 +13541,8 @@ abstract class _OpenApi extends OpenApi {
final Map<String, List<String>> extraSchemaMapping}) = _$OpenApiImpl;
const _OpenApi._() : super._();

factory _OpenApi.fromJson(Map<String, dynamic> json) = _$OpenApiImpl.fromJson;

@override

/// This string must be the version number of the
Expand Down
82 changes: 82 additions & 0 deletions lib/src/open_api/index.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/src/open_api/security.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Security with _$Security {
}
});

@override
Map<String, dynamic> toJson() {
if (name == null) {
return {};
Expand Down
1 change: 1 addition & 0 deletions lib/src/open_api/spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class OpenApi with _$OpenApi {
// ------------------------------------------

/// Convert the [OpenApi] object to a JSON spec representation
@override
Map<String, dynamic> toJson() {
if (paths == null && components == null && webhooks == null) {
throw Exception(
Expand Down

0 comments on commit ad5710b

Please sign in to comment.