Merge pull request #4161 from aaa2000/bug-empty-quote

API return an error with empty quote
This commit is contained in:
Jérémy Benoist
2019-12-04 16:09:49 -08:00
committed by GitHub
3 changed files with 61 additions and 3 deletions

View File

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

View File

@ -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"=false, "description"="Optional, 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"},
* }
* )
*