Add more `assert`s for checking required props

This commit is contained in:
krawieck 2020-08-12 11:55:26 +02:00
parent 1307b5e5b1
commit b433bf0971
2 changed files with 34 additions and 1 deletions

View File

@ -13,6 +13,10 @@ extension CommentEndpoint on V1 {
int formId, int formId,
@required String auth, @required String auth,
}) { }) {
assert(content != null);
assert(postId != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
@ -24,6 +28,10 @@ extension CommentEndpoint on V1 {
String formId, String formId,
@required String auth, @required String auth,
}) { }) {
assert(content != null);
assert(editId != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
@ -35,6 +43,10 @@ extension CommentEndpoint on V1 {
@required bool deleted, @required bool deleted,
@required String auth, @required String auth,
}) { }) {
assert(editId != null);
assert(deleted != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
@ -47,6 +59,10 @@ extension CommentEndpoint on V1 {
String reason, String reason,
@required String auth, @required String auth,
}) { }) {
assert(editId != null);
assert(removed != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
@ -57,6 +73,10 @@ extension CommentEndpoint on V1 {
@required bool read, @required bool read,
@required String auth, @required String auth,
}) { }) {
assert(editId != null);
assert(read != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
@ -67,6 +87,10 @@ extension CommentEndpoint on V1 {
@required bool save, @required bool save,
@required String auth, @required String auth,
}) { }) {
assert(commentId != null);
assert(save != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
@ -77,6 +101,10 @@ extension CommentEndpoint on V1 {
@required Vote score, @required Vote score,
@required String auth, @required String auth,
}) { }) {
assert(commentId != null);
assert(score != null);
assert(auth != null);
throw UnimplementedError(); throw UnimplementedError();
} }
} }

View File

@ -20,7 +20,7 @@ class V1 {
/// POST /search /// POST /search
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#search /// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#search
Search search({ Future<Search> search({
@required String q, @required String q,
@required SearchType type, @required SearchType type,
String communityId, String communityId,
@ -29,6 +29,10 @@ class V1 {
int limit, int limit,
String auth, String auth,
}) { }) {
assert(q != null);
assert(type != null);
assert(sort != null);
throw UnimplementedError(); throw UnimplementedError();
} }
} }
@ -76,6 +80,7 @@ extension PostTypeValue on PostListingType {
enum SortType { enum SortType {
active, active,
hot, hot,
// ignore: constant_identifier_names
new_, new_,
topDay, topDay,
topWeek, topWeek,