Skip to content

Commit 296d0f9

Browse files
committed
Implement annotation-store rules directly in StoreImageAnnotation
1 parent ae7d882 commit 296d0f9

File tree

2 files changed

+7
-54
lines changed

2 files changed

+7
-54
lines changed

app/Http/Requests/StoreImageAnnotation.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use Biigle\Image;
66
use Biigle\Shape;
7+
use Illuminate\Foundation\Http\FormRequest;
78

8-
class StoreImageAnnotation extends StoreImageAnnotationLabelFeatureVector
9+
class StoreImageAnnotation extends FormRequest
910
{
1011
/**
1112
* The image on which the annotation should be created.
@@ -33,10 +34,13 @@ public function authorize()
3334
*/
3435
public function rules()
3536
{
36-
return array_merge(parent::rules(), [
37+
return [
38+
'label_id' => 'required_without:feature_vector|integer|exists:labels,id',
39+
'feature_vector' => 'required_without:label_id|array|size:384',
40+
'confidence' => 'required|numeric|between:0,1',
3741
'shape_id' => 'required|integer|exists:shapes,id',
3842
'points' => 'required|array',
39-
]);
43+
];
4044
}
4145

4246
/**

app/Http/Requests/StoreImageAnnotationLabelFeatureVector.php

-51
This file was deleted.

0 commit comments

Comments
 (0)