Skip to content

Commit 0f09ec0

Browse files
committed
feat(api): updated API version to 3.2 (#3830)
1 parent 1e5173e commit 0f09ec0

File tree

14 files changed

+27
-27
lines changed

14 files changed

+27
-27
lines changed

phpmyfaq/api/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* phpMyFAQ REST API: api/v3.1/version
4+
* phpMyFAQ REST API: api/v3.2/version
55
*
66
* This Source Code Form is subject to the terms of the Mozilla Public License,
77
* v. 2.0. If a copy of the MPL was not distributed with this file, You can

phpmyfaq/src/phpMyFAQ/Controller/AbstractController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
use Twig\TwigFilter;
4242

4343
#[OA\Info(
44-
version: '3.1',
44+
version: '3.2',
4545
description: 'phpMyFAQ includes a REST API and offers APIs for various services like fetching the phpMyFAQ '
4646
. 'version or doing a search against the phpMyFAQ installation.',
47-
title: 'REST API for phpMyFAQ 4.1',
47+
title: 'REST API for phpMyFAQ 4.2',
4848
contact: new OA\Contact(name: 'phpMyFAQ Team', email: '[email protected]'),
4949
)]
5050
#[OA\Server(url: 'https://localhost', description: 'Local dockerized server')]

phpmyfaq/src/phpMyFAQ/Controller/Api/BackupController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct()
4747
/**
4848
* @throws Exception
4949
*/
50-
#[OA\Get(path: '/api/v3.1/backup/{type}', operationId: 'createBackup', tags: ['Endpoints with Authentication'])]
50+
#[OA\Get(path: '/api/v3.2/backup/{type}', operationId: 'createBackup', tags: ['Endpoints with Authentication'])]
5151
#[OA\Header(
5252
header: 'Accept-Language',
5353
description: 'The language code for the login.',

phpmyfaq/src/phpMyFAQ/Controller/Api/FaqController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct()
4848
* @throws \phpMyFAQ\Core\Exception|Exception
4949
*/
5050
#[OA\Get(
51-
path: '/api/v3.1/faqs/{categoryId}',
51+
path: '/api/v3.2/faqs/{categoryId}',
5252
operationId: 'getByCategoryId',
5353
description: 'This endpoint returns all the FAQs with a preview of the answer for the given category ID and '
5454
. 'the language provided by "Accept-Language".',
@@ -104,7 +104,7 @@ public function getByCategoryId(Request $request): JsonResponse
104104
* @throws \phpMyFAQ\Core\Exception|Exception
105105
*/
106106
#[OA\Get(
107-
path: '/api/v3.1/faq/{categoryId}/{faqId}',
107+
path: '/api/v3.2/faq/{categoryId}/{faqId}',
108108
operationId: 'getFaqById',
109109
description: 'This endpoint returns the FAQ for the given FAQ ID and the language provided by '
110110
. '"Accept-Language".',
@@ -179,7 +179,7 @@ public function getById(Request $request): JsonResponse
179179
* @throws Exception
180180
*/
181181
#[OA\Get(
182-
path: '/api/v3.1/faqs/tags/{tagId}',
182+
path: '/api/v3.2/faqs/tags/{tagId}',
183183
operationId: 'getByTagId',
184184
description: 'This endpoint returns all the FAQs for the given tag ID and the language provided by '
185185
. '
@@ -239,7 +239,7 @@ public function getByTagId(Request $request): JsonResponse
239239
* @throws \phpMyFAQ\Core\Exception|Exception
240240
*/
241241
#[OA\Get(
242-
path: '/api/v3.1/faqs/popular',
242+
path: '/api/v3.2/faqs/popular',
243243
operationId: 'getPopular',
244244
description: 'This endpoint returns the popular FAQs for the given language provided by "Accept-Language".',
245245
tags: ['Public Endpoints'],
@@ -287,7 +287,7 @@ public function getPopular(): JsonResponse
287287
* @throws Exception
288288
*/
289289
#[OA\Get(
290-
path: '/api/v3.1/faqs/latest',
290+
path: '/api/v3.2/faqs/latest',
291291
operationId: 'getLatest',
292292
description: 'This endpoint returns the latest FAQs for the given language provided by "Accept-Language".',
293293
tags: ['Public Endpoints'],
@@ -334,7 +334,7 @@ public function getLatest(): JsonResponse
334334
* @throws \phpMyFAQ\Core\Exception|Exception
335335
*/
336336
#[OA\Get(
337-
path: '/api/v3.1/faqs/trending',
337+
path: '/api/v3.2/faqs/trending',
338338
operationId: 'getTrending',
339339
description: 'This endpoint returns the trending FAQs for the given language provided by "Accept-Language".',
340340
tags: ['Public Endpoints'],
@@ -381,7 +381,7 @@ public function getTrending(): JsonResponse
381381
* @throws \phpMyFAQ\Core\Exception|Exception
382382
*/
383383
#[OA\Get(
384-
path: '/api/v3.1/faqs/sticky',
384+
path: '/api/v3.2/faqs/sticky',
385385
operationId: 'getSticky',
386386
description: 'This endpoint returns the sticky FAQs for the given language provided by "Accept-Language".',
387387
tags: ['Public Endpoints'],
@@ -433,7 +433,7 @@ public function getSticky(): JsonResponse
433433
* @throws \phpMyFAQ\Core\Exception|Exception
434434
*/
435435
#[OA\Get(
436-
path: '/api/v3.1/faqs',
436+
path: '/api/v3.2/faqs',
437437
operationId: 'getAll',
438438
description: 'This endpoint returns all the FAQs for the given language provided by "Accept-Language".',
439439
tags: ['Public Endpoints'],
@@ -491,7 +491,7 @@ public function list(): JsonResponse
491491
/**
492492
* @throws \phpMyFAQ\Core\Exception|\JsonException|Exception
493493
*/
494-
#[OA\Post(path: '/api/v3.1/faq/create', operationId: 'createFaq', tags: ['Endpoints with Authentication'])]
494+
#[OA\Post(path: '/api/v3.2/faq/create', operationId: 'createFaq', tags: ['Endpoints with Authentication'])]
495495
#[OA\Header(
496496
header: 'Accept-Language',
497497
description: 'The language code for the login.',
@@ -656,7 +656,7 @@ public function create(Request $request): JsonResponse
656656
* @throws \phpMyFAQ\Core\Exception|\JsonException|Exception
657657
*/
658658
#[OA\Put(
659-
path: '/api/v3.1/faq/update',
659+
path: '/api/v3.2/faq/update',
660660
operationId: 'updateFaq',
661661
description: 'Used to update a FAQ in one existing category.',
662662
tags: ['Endpoints with Authentication'],

phpmyfaq/src/phpMyFAQ/Controller/Api/GroupController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct()
3838
}
3939

4040
#[OA\Get(
41-
path: '/api/v3.1/groups',
41+
path: '/api/v3.2/groups',
4242
operationId: 'getGroups',
4343
description: 'Used to fetch all group IDs.',
4444
tags: ['Endpoints with Authentication'],

phpmyfaq/src/phpMyFAQ/Controller/Api/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct()
4646
/**
4747
* @throws JsonException|Exception
4848
*/
49-
#[OA\Post(path: '/api/v3.1/login', operationId: 'login', tags: ['Public Endpoints'])]
49+
#[OA\Post(path: '/api/v3.2/login', operationId: 'login', tags: ['Public Endpoints'])]
5050
#[OA\Header(
5151
header: 'Accept-Language',
5252
description: 'The language code for the login.',

phpmyfaq/src/phpMyFAQ/Controller/Api/OpenQuestionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct()
3939

4040
/**
4141
* @throws \Exception
42-
*/ #[OA\Get(path: '/api/v3.1/open-questions', operationId: 'getOpenQuestions', tags: ['Public Endpoints'])]
42+
*/ #[OA\Get(path: '/api/v3.2/open-questions', operationId: 'getOpenQuestions', tags: ['Public Endpoints'])]
4343
#[OA\Header(
4444
header: 'Accept-Language',
4545
description: 'The language code for the open questions.',

phpmyfaq/src/phpMyFAQ/Controller/Api/PdfController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct()
4747
* @throws Exception
4848
*/
4949
#[OA\Get(
50-
path: '/api/v3.1/pdf/{categoryId}/{faqId}',
50+
path: '/api/v3.2/pdf/{categoryId}/{faqId}',
5151
operationId: 'getPdfById',
5252
description: 'This endpoint returns the URL to the PDF of FAQ for the given FAQ ID and the language provided '
5353
. 'by "Accept-Language".',

phpmyfaq/src/phpMyFAQ/Controller/Api/SearchController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct()
4747
/**
4848
* @throws Exception
4949
*/
50-
#[OA\Get(path: '/api/v3.1/search', operationId: 'getSearch', tags: ['Public Endpoints'])]
50+
#[OA\Get(path: '/api/v3.2/search', operationId: 'getSearch', tags: ['Public Endpoints'])]
5151
#[OA\Parameter(
5252
name: 'q',
5353
description: 'The search term',
@@ -106,7 +106,7 @@ public function search(Request $request): JsonResponse
106106
return $this->json([], Response::HTTP_NOT_FOUND);
107107
}
108108

109-
#[OA\Get(path: '/api/v3.1/searches/popular', operationId: 'getPopularSearch', tags: ['Public Endpoints'])]
109+
#[OA\Get(path: '/api/v3.2/searches/popular', operationId: 'getPopularSearch', tags: ['Public Endpoints'])]
110110
#[OA\Header(
111111
header: 'Accept-Language',
112112
description: 'The language code for the login.',

phpmyfaq/src/phpMyFAQ/Controller/Api/TagController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct()
4040
/**
4141
* @throws \Exception
4242
*/
43-
#[OA\Get(path: '/api/v3.1/tags', operationId: 'getTags', tags: ['Public Endpoints'])]
43+
#[OA\Get(path: '/api/v3.2/tags', operationId: 'getTags', tags: ['Public Endpoints'])]
4444
#[OA\Response(
4545
response: 200,
4646
description: 'Returns the tags for the given language provided by "Accept-Language".',

0 commit comments

Comments
 (0)