mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-31 07:47:28 +01:00
Merge pull request #6182 from caspermeijn/openapi3
Update annotations to OpenApi 3
This commit is contained in:
commit
7625e36b5a
@ -130,12 +130,13 @@ nelmio_api_doc:
|
||||
title: wallabag API documentation
|
||||
description: This is the API documentation of wallabag
|
||||
version: 2.x
|
||||
securityDefinitions:
|
||||
Bearer:
|
||||
type: apiKey
|
||||
description: 'Value: Bearer {jwt}'
|
||||
name: Authorization
|
||||
in: header
|
||||
components:
|
||||
securitySchemes:
|
||||
Bearer:
|
||||
type: apiKey
|
||||
description: 'Value: Bearer {jwt}'
|
||||
name: Authorization
|
||||
in: header
|
||||
security:
|
||||
- Bearer: []
|
||||
|
||||
|
@ -86,7 +86,7 @@
|
||||
"lexik/form-filter-bundle": "^7.0",
|
||||
"mgargano/simplehtmldom": "~1.5",
|
||||
"mnapoli/piwik-twig-extension": "^3.0",
|
||||
"nelmio/api-doc-bundle": "^3.0",
|
||||
"nelmio/api-doc-bundle": "^4.10",
|
||||
"nelmio/cors-bundle": "~2.2",
|
||||
"ocramius/proxy-manager": "^2.1.1",
|
||||
"pagerfanta/doctrine-orm-adapter": "^3.7",
|
||||
|
194
composer.lock
generated
194
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "5eb04015c33ddf2996bb1d1c97b71daf",
|
||||
"content-hash": "12d17d887bf9d5652741793a66f4ef9e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "babdev/pagerfanta-bundle",
|
||||
@ -647,16 +647,16 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
"version": "1.14.1",
|
||||
"version": "1.14.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/annotations.git",
|
||||
"reference": "9e034d7a70032d422169f27d8759e8d84abb4f51"
|
||||
"reference": "ad785217c1e9555a7d6c6c8c9f406395a5e2882b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51",
|
||||
"reference": "9e034d7a70032d422169f27d8759e8d84abb4f51",
|
||||
"url": "https://api.github.com/repos/doctrine/annotations/zipball/ad785217c1e9555a7d6c6c8c9f406395a5e2882b",
|
||||
"reference": "ad785217c1e9555a7d6c6c8c9f406395a5e2882b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -717,9 +717,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/annotations/issues",
|
||||
"source": "https://github.com/doctrine/annotations/tree/1.14.1"
|
||||
"source": "https://github.com/doctrine/annotations/tree/1.14.2"
|
||||
},
|
||||
"time": "2022-12-12T12:46:12+00:00"
|
||||
"time": "2022-12-15T06:48:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
@ -2205,49 +2205,6 @@
|
||||
},
|
||||
"time": "2022-02-21T09:13:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "exsyst/swagger",
|
||||
"version": "v0.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/GuilhemN/swagger.git",
|
||||
"reference": "5d4ad40fe816b7783adc090b64fba6c392be64bc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/GuilhemN/swagger/zipball/5d4ad40fe816b7783adc090b64fba6c392be64bc",
|
||||
"reference": "5d4ad40fe816b7783adc090b64fba6c392be64bc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^4.1.8|^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"EXSyst\\Component\\Swagger\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Guilhem Niot",
|
||||
"email": "guilhem@gniot.fr"
|
||||
}
|
||||
],
|
||||
"description": "A php library to manipulate Swagger specifications",
|
||||
"support": {
|
||||
"issues": "https://github.com/GuilhemN/swagger/issues",
|
||||
"source": "https://github.com/GuilhemN/swagger/tree/v0.4.2"
|
||||
},
|
||||
"time": "2020-11-19T17:14:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fossar/htmlawed",
|
||||
"version": "1.3.1",
|
||||
@ -6165,63 +6122,79 @@
|
||||
},
|
||||
{
|
||||
"name": "nelmio/api-doc-bundle",
|
||||
"version": "v3.10.1",
|
||||
"version": "v4.10.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nelmio/NelmioApiDocBundle.git",
|
||||
"reference": "f5fb7a408824d44d36453f6edff20f9fa05296a1"
|
||||
"reference": "52921ac56e49b20ad3ee00bca0ee04870f21b7af"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/f5fb7a408824d44d36453f6edff20f9fa05296a1",
|
||||
"reference": "f5fb7a408824d44d36453f6edff20f9fa05296a1",
|
||||
"url": "https://api.github.com/repos/nelmio/NelmioApiDocBundle/zipball/52921ac56e49b20ad3ee00bca0ee04870f21b7af",
|
||||
"reference": "52921ac56e49b20ad3ee00bca0ee04870f21b7af",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"exsyst/swagger": "^0.4.1",
|
||||
"php": ">=7.1.3",
|
||||
"doctrine/annotations": "^1.11",
|
||||
"ext-json": "*",
|
||||
"php": ">=7.2",
|
||||
"phpdocumentor/reflection-docblock": "^3.1|^4.0|^5.0",
|
||||
"symfony/framework-bundle": "^3.4|^4.0|^5.0",
|
||||
"symfony/options-resolver": "^3.4.4|^4.0|^5.0",
|
||||
"symfony/property-info": "^3.4|^4.0|^5.0",
|
||||
"zircote/swagger-php": "^2.0.9"
|
||||
"psr/cache": "^1.0|^2.0|^3.0",
|
||||
"psr/container": "^1.0|^2.0",
|
||||
"psr/log": "^1.0|^2.0|^3.0",
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/console": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
|
||||
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-foundation": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-kernel": "^4.4|^5.0|^6.0",
|
||||
"symfony/options-resolver": "^4.4|^5.0|^6.0",
|
||||
"symfony/property-info": "^4.4|^5.0|^6.0",
|
||||
"symfony/routing": "^4.4|^5.0|^6.0",
|
||||
"zircote/swagger-php": "^4.2.15"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/framework-bundle": "4.2.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"api-platform/core": "^2.1.2",
|
||||
"doctrine/annotations": "^1.2",
|
||||
"doctrine/common": "^2.4",
|
||||
"friendsofsymfony/rest-bundle": "^2.0|^3.0",
|
||||
"api-platform/core": "^2.7.0|^3@dev",
|
||||
"composer/package-versions-deprecated": "1.11.99.1",
|
||||
"friendsofsymfony/rest-bundle": "^2.8|^3.0",
|
||||
"jms/serializer": "^1.14|^3.0",
|
||||
"jms/serializer-bundle": "^2.3|^3.0",
|
||||
"sensio/framework-extra-bundle": "^3.0.13|^4.0|^5.0",
|
||||
"symfony/asset": "^3.4|^4.0|^5.0",
|
||||
"symfony/browser-kit": "^3.4|^4.0|^5.0",
|
||||
"symfony/cache": "^3.4|^4.0|^5.0",
|
||||
"symfony/config": "^3.4|^4.0|^5.0",
|
||||
"symfony/console": "^3.4|^4.0|^5.0",
|
||||
"symfony/dom-crawler": "^3.4|^4.0|^5.0",
|
||||
"symfony/expression-language": "^3.4|^4.0|^5.0",
|
||||
"symfony/form": "^3.4|^4.0|^5.0",
|
||||
"symfony/phpunit-bridge": "^3.4.24|^4.0|^5.0",
|
||||
"symfony/property-access": "^3.4|^4.0|^5.0",
|
||||
"symfony/routing": "^3.4.42|^4.0|^5.0",
|
||||
"symfony/stopwatch": "^3.4|^4.0|^5.0",
|
||||
"symfony/templating": "^3.4|^4.0|^5.0",
|
||||
"symfony/twig-bundle": "^3.4|^4.0|^5.0",
|
||||
"symfony/validator": "^3.4|^4.0|^5.0",
|
||||
"jms/serializer-bundle": "^2.3|^3.0|^4.0|^5.0@beta",
|
||||
"sensio/framework-extra-bundle": "^4.4|^5.2|^6.0",
|
||||
"symfony/asset": "^4.4|^5.2|^6.0",
|
||||
"symfony/browser-kit": "^4.4|^5.2|^6.0",
|
||||
"symfony/cache": "^4.4|^5.2|^6.0",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/dom-crawler": "^4.4|^5.2|^6.0",
|
||||
"symfony/form": "^4.4|^5.2|^6.0",
|
||||
"symfony/phpunit-bridge": "^5.2",
|
||||
"symfony/property-access": "^4.4|^5.2|^6.0",
|
||||
"symfony/serializer": "^4.4|^5.2|^6.0",
|
||||
"symfony/stopwatch": "^4.4|^5.2|^6.0",
|
||||
"symfony/templating": "^4.4|^5.2|^6.0",
|
||||
"symfony/twig-bundle": "^4.4|^5.2|^6.0",
|
||||
"symfony/validator": "^4.4|^5.2|^6.0",
|
||||
"willdurand/hateoas-bundle": "^1.0|^2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"api-platform/core": "For using an API oriented framework.",
|
||||
"friendsofsymfony/rest-bundle": "For using the parameters annotations."
|
||||
"friendsofsymfony/rest-bundle": "For using the parameters annotations.",
|
||||
"jms/serializer-bundle": "For describing your models.",
|
||||
"symfony/asset": "For using the Swagger UI.",
|
||||
"symfony/cache": "For using a PSR-6 compatible cache implementation with the API doc generator.",
|
||||
"symfony/form": "For describing your form type models.",
|
||||
"symfony/monolog-bundle": "For using a PSR-3 compatible logger implementation with the API PHP describer.",
|
||||
"symfony/serializer": "For describing your models.",
|
||||
"symfony/twig-bundle": "For using the Swagger UI.",
|
||||
"symfony/validator": "For describing the validation constraints in your models.",
|
||||
"willdurand/hateoas-bundle": "For extracting HATEOAS metadata."
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-3.x": "3.7.x-dev"
|
||||
"dev-master": "4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@ -6229,7 +6202,7 @@
|
||||
"Nelmio\\ApiDocBundle\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
"Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@ -6255,9 +6228,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nelmio/NelmioApiDocBundle/issues",
|
||||
"source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v3.10.1"
|
||||
"source": "https://github.com/nelmio/NelmioApiDocBundle/tree/v4.10.2"
|
||||
},
|
||||
"time": "2021-12-11T13:22:14+00:00"
|
||||
"time": "2022-10-18T19:55:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nelmio/cors-bundle",
|
||||
@ -11797,37 +11770,46 @@
|
||||
},
|
||||
{
|
||||
"name": "zircote/swagger-php",
|
||||
"version": "2.1.2",
|
||||
"version": "4.5.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zircote/swagger-php.git",
|
||||
"reference": "f144351118e6bcc04a275f490d7e359a3dd62586"
|
||||
"reference": "e505bce612a86fe90f8fd50917e0848afc5d2ba8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zircote/swagger-php/zipball/f144351118e6bcc04a275f490d7e359a3dd62586",
|
||||
"reference": "f144351118e6bcc04a275f490d7e359a3dd62586",
|
||||
"url": "https://api.github.com/repos/zircote/swagger-php/zipball/e505bce612a86fe90f8fd50917e0848afc5d2ba8",
|
||||
"reference": "e505bce612a86fe90f8fd50917e0848afc5d2ba8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/annotations": "^1.7",
|
||||
"ext-json": "*",
|
||||
"php": ">=7.2",
|
||||
"symfony/finder": ">=3.4"
|
||||
"psr/log": "^1.1 || ^2.0 || ^3.0",
|
||||
"symfony/deprecation-contracts": "^2 || ^3",
|
||||
"symfony/finder": ">=2.2",
|
||||
"symfony/yaml": ">=3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8 || ^9",
|
||||
"squizlabs/php_codesniffer": ">=2.7"
|
||||
"composer/package-versions-deprecated": "^1.11",
|
||||
"friendsofphp/php-cs-fixer": "^2.17 || ^3.0",
|
||||
"phpstan/phpstan": "^1.6",
|
||||
"phpunit/phpunit": ">=8",
|
||||
"vimeo/psalm": "^4.23"
|
||||
},
|
||||
"bin": [
|
||||
"bin/swagger"
|
||||
"bin/openapi"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Swagger\\": "src"
|
||||
"OpenApi\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@ -11837,16 +11819,20 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "Robert Allen",
|
||||
"email": "zircote@gmail.com",
|
||||
"homepage": "http://www.zircote.com"
|
||||
"email": "zircote@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Bob Fanger",
|
||||
"email": "bfanger@gmail.com",
|
||||
"homepage": "http://bfanger.nl"
|
||||
"homepage": "https://bfanger.nl"
|
||||
},
|
||||
{
|
||||
"name": "Martin Rademacher",
|
||||
"email": "mano@radebatz.net",
|
||||
"homepage": "https://radebatz.net"
|
||||
}
|
||||
],
|
||||
"description": "Swagger-PHP - Generate interactive documentation for your RESTful API using phpdoc annotations",
|
||||
"description": "swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations",
|
||||
"homepage": "https://github.com/zircote/swagger-php/",
|
||||
"keywords": [
|
||||
"api",
|
||||
@ -11856,9 +11842,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/zircote/swagger-php/issues",
|
||||
"source": "https://github.com/zircote/swagger-php/tree/2.1.2"
|
||||
"source": "https://github.com/zircote/swagger-php/tree/4.5.3"
|
||||
},
|
||||
"time": "2022-06-18T00:00:23+00:00"
|
||||
"time": "2022-12-21T18:26:59+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Swagger\Annotations as SWG;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
@ -19,15 +19,17 @@ class AnnotationRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Annotations"},
|
||||
* summary="Retrieve annotations for an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -52,40 +54,48 @@ class AnnotationRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Annotations"},
|
||||
* summary="Creates a new annotation.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* name="ranges",
|
||||
* in="body",
|
||||
* description="The range array for the annotation",
|
||||
* required=false,
|
||||
* pattern="\w+",
|
||||
* @SWG\Schema(
|
||||
* type="array",
|
||||
* @SWG\Items(type="string")
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* name="quote",
|
||||
* in="body",
|
||||
* description="The annotated text",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\RequestBody(
|
||||
* @OA\JsonContent(
|
||||
* type="object",
|
||||
* required={"text"},
|
||||
* @OA\Property(
|
||||
* property="ranges",
|
||||
* type="array",
|
||||
* description="The range array for the annotation",
|
||||
* @OA\Items(
|
||||
* type="string",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="quote",
|
||||
* type="array",
|
||||
* description="The annotated text",
|
||||
* @OA\Items(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="text",
|
||||
* type="array",
|
||||
* description="Content of annotation",
|
||||
* @OA\Items(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* name="text",
|
||||
* in="body",
|
||||
* description="Content of annotation",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -111,15 +121,17 @@ class AnnotationRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Annotations"},
|
||||
* summary="Updates an annotation.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="annotation",
|
||||
* in="path",
|
||||
* description="The annotation ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="string"
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -146,15 +158,17 @@ class AnnotationRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Annotations"},
|
||||
* summary="Removes an annotation.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="annotation",
|
||||
* in="path",
|
||||
* description="The annotation ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="string"
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -5,7 +5,7 @@ namespace Wallabag\ApiBundle\Controller;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use Swagger\Annotations as SWG;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
@ -17,7 +17,7 @@ class ConfigRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Config"},
|
||||
* summary="Retrieve configuration for current user.",
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -5,9 +5,9 @@ namespace Wallabag\ApiBundle\Controller;
|
||||
use Hateoas\Configuration\Route as HateoasRoute;
|
||||
use Hateoas\Representation\Factory\PagerfantaFactory;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Swagger\Annotations as SWG;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -38,46 +38,46 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Check if an entry exist by url.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="return_id",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Set 1 if you want to retrieve ID in case entry(ies) exists, 0 by default",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="url",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="DEPRECATED, use hashed_url instead. An url",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="urls",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="DEPRECATED, use hashed_urls instead. An array of urls (?urls[]=http...&urls[]=http...)",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="hashed_url",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Hashed url using SHA1 to check if it exists. A hashed url",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="hashed_urls",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="An array of hashed urls using SHA1 to check if they exist. An array of hashed urls (?hashed_urls[]=xxx...&hashed_urls[]=xxx...)",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -153,124 +153,123 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Retrieve all entries. It could be filtered by many options.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="archive",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="filter by archived status. all entries by default.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="starred",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="filter by starred status. all entries by default",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="sort",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="sort entries by date.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"created", "updated", "archived"},
|
||||
* default="created"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="order",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="order of sort.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"asc", "desc"},
|
||||
* default="desc"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="page",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="what page you want.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* default=1
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="perPage",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="results per page.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* default=30
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tags",
|
||||
* in="body",
|
||||
* description="a list of tags url encoded. Will returns entries that matches ALL tags.",
|
||||
* in="query",
|
||||
* description="a comma-seperated list of tags url encoded. Will returns entries that matches ALL tags.",
|
||||
* required=false,
|
||||
* format="comma-seperated",
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="api,rest"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="since",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="The timestamp since when you want entries updated.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* default=0
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="public",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="filter by entries with a public link. all entries by default",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="detail",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="include content field if 'full'. 'full' by default for backward compatibility.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"metadata", "full"},
|
||||
* default="full"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="domain_name",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="filter entries with the given domain name",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="example.com",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -347,15 +346,17 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Retrieve a single entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -379,23 +380,27 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Retrieve a single entry as a predefined format.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="_format",
|
||||
* in="path",
|
||||
* description="",
|
||||
* required=true,
|
||||
* type="string",
|
||||
* enum={"xml", "json", "txt", "csv", "pdf", "epub", "mobi"},
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"xml", "json", "txt", "csv", "pdf", "epub", "mobi"},
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -423,14 +428,14 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Handles an entries list and delete URL.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="urls",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Urls (as an array) to delete. A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -481,14 +486,14 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Handles an entries list and create URL.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="urls",
|
||||
* in="formData",
|
||||
* in="query",
|
||||
* description="Urls (as an array) to create. A JSON array of urls [{'url': 'http://...'}, {'url': 'http://...'}]",
|
||||
* required=true,
|
||||
* type="string"
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -553,126 +558,127 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Create an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="url",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Url for the entry.",
|
||||
* required=true,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="http://www.test.com/article.html"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="title",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Optional, we'll get the title from the page.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tags",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="a comma-separated list of tags.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="tag1,tag2,tag3"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="archive",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="entry already archived",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="starred",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="entry already starred",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="content",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Content of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="language",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Language of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="preview_picture",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Preview picture of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="published_at",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Published date of the entry",
|
||||
* required=false,
|
||||
* format="YYYY-MM-DDTHH:II:SS+TZ or a timestamp (integer)",
|
||||
* @SWG\Schema(
|
||||
*
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* format="YYYY-MM-DDTHH:II:SS+TZ or a timestamp (integer)",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="authors",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Authors of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="Name Firstname,author2,author3"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="public",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="will generate a public link for the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="origin_url",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Origin url for the entry (from where you found it).",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="http://www.test.com/article.html"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -769,114 +775,118 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Change several properties of an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="title",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tags",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="a comma-separated list of tags.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="tag1,tag2,tag3",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="archive",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="archived the entry.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="starred",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="starred the entry.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="content",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Content of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="language",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Language of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="preview_picture",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Preview picture of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="published_at",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Published date of the entry",
|
||||
* required=false,
|
||||
* format="YYYY-MM-DDTHH:II:SS+TZ or a timestamp",
|
||||
* @SWG\Schema(type="datetime|integer")
|
||||
* @OA\Schema(
|
||||
* type="datetime|integer",
|
||||
* format="YYYY-MM-DDTHH:II:SS+TZ or a timestamp",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="authors",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Authors of the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="Name Firstname,author2,author3",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="public",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="will generate a public link for the entry",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* enum={"1", "0"},
|
||||
* default="0"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="origin_url",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Origin url for the entry (from where you found it).",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="http://www.test.com/article.html",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -983,15 +993,17 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Reload an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -1037,18 +1049,18 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Delete permanently an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="expect",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Only returns the id instead of the deleted entry's full entity if 'id' is specified.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* enum={"id", "entry"},
|
||||
* default="entry"
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -1091,15 +1103,17 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Retrieve all tags for an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -1123,25 +1137,27 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Add one or more tags to an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tags",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="a comma-separated list of tags.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="tag1,tag2,tag3",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -1173,23 +1189,27 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Permanently remove one tag for an entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="entry",
|
||||
* in="path",
|
||||
* description="The entry ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tag",
|
||||
* in="path",
|
||||
* description="The tag ID",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* type="integer"
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -1218,14 +1238,14 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Handles an entries list delete tags from them.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="list",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Urls (as an array) to handle. A JSON array of urls [{'url': 'http://...','tags': 'tag1, tag2'}, {'url': 'http://...','tags': 'tag1, tag2'}]",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -1285,14 +1305,14 @@ class EntryRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Entries"},
|
||||
* summary="Handles an entries list and add tags to them.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="list",
|
||||
* in="formData",
|
||||
* in="query",
|
||||
* description="Urls (as an array) to handle. A JSON array of urls [{'url': 'http://...','tags': 'tag1, tag2'}, {'url': 'http://...','tags': 'tag1, tag2'}]",
|
||||
* required=true,
|
||||
* type="string"
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -5,9 +5,9 @@ namespace Wallabag\ApiBundle\Controller;
|
||||
use Hateoas\Configuration\Route as HateoasRoute;
|
||||
use Hateoas\Representation\Factory\PagerfantaFactory;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
use Swagger\Annotations as SWG;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
@ -21,34 +21,34 @@ class SearchRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Search"},
|
||||
* summary="Search all entries by term.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="term",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Any query term",
|
||||
* required=false,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="page",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="what page you want.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* default=1
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="perPage",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="results per page.",
|
||||
* required=false,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* default=30
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use Swagger\Annotations as SWG;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
@ -20,7 +20,7 @@ class TagRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Tags"},
|
||||
* summary="Retrieve all tags.",
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -47,15 +47,17 @@ class TagRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Tags"},
|
||||
* summary="Permanently remove one tag from every entry by passing the Tag label.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tag",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Tag as a string",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -93,17 +95,17 @@ class TagRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Tags"},
|
||||
* summary="Permanently remove some tags from every entry.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tags",
|
||||
* in="body",
|
||||
* in="query",
|
||||
* description="Tags as strings (comma splitted)",
|
||||
* required=true,
|
||||
* @SWG\Schema(
|
||||
* @OA\Schema(
|
||||
* type="string",
|
||||
* example="tag1,tag2",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -140,15 +142,17 @@ class TagRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"Tags"},
|
||||
* summary="Permanently remove one tag from every entry by passing the Tag ID.",
|
||||
* @SWG\Parameter(
|
||||
* @OA\Parameter(
|
||||
* name="tag",
|
||||
* in="body",
|
||||
* in="path",
|
||||
* description="The tag",
|
||||
* required=true,
|
||||
* pattern="\w+",
|
||||
* @SWG\Schema(type="integer")
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* pattern="\w+",
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -5,7 +5,7 @@ namespace Wallabag\ApiBundle\Controller;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerBuilder;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use Swagger\Annotations as SWG;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
@ -17,7 +17,7 @@ class TaggingRuleRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"TaggingRule"},
|
||||
* summary="Export all tagging rules as a json file.",
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -9,7 +9,7 @@ use FOS\UserBundle\FOSUserEvents;
|
||||
use FOS\UserBundle\Model\UserManagerInterface;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use Swagger\Annotations as SWG;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -26,7 +26,7 @@ class UserRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"User"},
|
||||
* summary="Retrieve current logged in user informations.",
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -49,35 +49,33 @@ class UserRestController extends WallabagRestController
|
||||
* @Operation(
|
||||
* tags={"User"},
|
||||
* summary="Register an user and create a client.",
|
||||
* @SWG\Parameter(
|
||||
* name="username",
|
||||
* in="body",
|
||||
* description="The user's username",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* @OA\RequestBody(
|
||||
* @OA\JsonContent(
|
||||
* type="object",
|
||||
* required={"username", "password", "email", "client_name"},
|
||||
* @OA\Property(
|
||||
* property="username",
|
||||
* description="The user's username",
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="password",
|
||||
* description="The user's password",
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="email",
|
||||
* description="The user's email",
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="client_name",
|
||||
* description="The client name (to be used by your app)",
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
* )
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* name="password",
|
||||
* in="body",
|
||||
* description="The user's password",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* name="email",
|
||||
* in="body",
|
||||
* description="The user's email",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Parameter(
|
||||
* name="client_name",
|
||||
* in="body",
|
||||
* description="The client name (to be used by your app)",
|
||||
* required=true,
|
||||
* @SWG\Schema(type="string")
|
||||
* ),
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
@ -7,7 +7,7 @@ use FOS\RestBundle\Controller\AbstractFOSRestController;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use Swagger\Annotations as SWG;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
@ -39,7 +39,7 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
* @Operation(
|
||||
* tags={"Informations"},
|
||||
* summary="Retrieve version number.",
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
@ -65,7 +65,7 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
* @Operation(
|
||||
* tags={"Informations"},
|
||||
* summary="Retrieve information about the wallabag instance.",
|
||||
* @SWG\Response(
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
* )
|
||||
|
Loading…
x
Reference in New Issue
Block a user