From 86c1751186ab71a54e33092cd9fb83c33917f619 Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 24 Nov 2019 10:44:26 +0100 Subject: [PATCH] Optionnal quote because the frontend does not use it --- src/Wallabag/AnnotationBundle/Entity/Annotation.php | 1 - src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php | 2 +- .../ApiBundle/Controller/AnnotationRestController.php | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Wallabag/AnnotationBundle/Entity/Annotation.php b/src/Wallabag/AnnotationBundle/Entity/Annotation.php index ee7c1931..a180d504 100644 --- a/src/Wallabag/AnnotationBundle/Entity/Annotation.php +++ b/src/Wallabag/AnnotationBundle/Entity/Annotation.php @@ -60,7 +60,6 @@ class Annotation /** * @var string * - * @Assert\NotNull() * @Assert\Length( * max = 10000, * maxMessage = "validator.quote_length_too_high" diff --git a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php index aac6445c..48bc2c59 100644 --- a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php +++ b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php @@ -17,7 +17,7 @@ class NewAnnotationType extends AbstractType 'empty_data' => '', ]) ->add('quote', null, [ - 'empty_data' => null, + 'empty_data' => '', 'trim' => false, ]) ->add('ranges', CollectionType::class, [ diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php index e5b3eb27..66693189 100644 --- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php +++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php @@ -37,8 +37,8 @@ class AnnotationRestController extends WallabagRestController * @ApiDoc( * requirements={ * {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, - * {"name"="quote", "dataType"="string", "required"=true, "description"="Quote for the annotation"}, - * {"name"="text", "dataType"="string", "required"=true, "description"=""}, + * {"name"="quote", "dataType"="string", "description"="The annotated text"}, + * {"name"="text", "dataType"="string", "required"=true, "description"="Content of annotation"}, * } * ) * -- 2.41.0