Optionnal quote because the frontend does not use it

This commit is contained in:
adev 2019-11-24 10:44:26 +01:00 committed by Jeremy Benoist
parent 8197f08266
commit 86c1751186
No known key found for this signature in database
GPG key ID: 84290C294324D304
3 changed files with 3 additions and 4 deletions

View file

@ -60,7 +60,6 @@ class Annotation
/** /**
* @var string * @var string
* *
* @Assert\NotNull()
* @Assert\Length( * @Assert\Length(
* max = 10000, * max = 10000,
* maxMessage = "validator.quote_length_too_high" * maxMessage = "validator.quote_length_too_high"

View file

@ -17,7 +17,7 @@ class NewAnnotationType extends AbstractType
'empty_data' => '', 'empty_data' => '',
]) ])
->add('quote', null, [ ->add('quote', null, [
'empty_data' => null, 'empty_data' => '',
'trim' => false, 'trim' => false,
]) ])
->add('ranges', CollectionType::class, [ ->add('ranges', CollectionType::class, [

View file

@ -37,8 +37,8 @@ class AnnotationRestController extends WallabagRestController
* @ApiDoc( * @ApiDoc(
* requirements={ * requirements={
* {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"}, * {"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"="quote", "dataType"="string", "description"="The annotated text"},
* {"name"="text", "dataType"="string", "required"=true, "description"=""}, * {"name"="text", "dataType"="string", "required"=true, "description"="Content of annotation"},
* } * }
* ) * )
* *