@@ -181,6 +181,73 @@ public function getList(
181181 return $ this ->json ($ this ->normalizer ->normalize ($ list ), Response::HTTP_OK );
182182 }
183183
184+ #[Route('/{listId}/public ' , name: 'get_one_public ' , requirements: ['listId ' => '\d+ ' ], methods: ['GET ' ])]
185+ #[OA \Get(
186+ path: '/api/v2/lists/{listId}/public ' ,
187+ description: '🚧 **Status: Beta** – This method is under development. Avoid using in production. ' .
188+ 'Returns a single subscriber list with specified ID. ' ,
189+ summary: 'Gets a subscriber list. ' ,
190+ tags: ['lists ' ],
191+ parameters: [
192+ new OA \Parameter (
193+ name: 'listId ' ,
194+ description: 'List ID ' ,
195+ in: 'path ' ,
196+ required: true ,
197+ schema: new OA \Schema (type: 'string ' )
198+ ),
199+ ],
200+ responses: [
201+ new OA \Response (
202+ response: 200 ,
203+ description: 'Success ' ,
204+ content: [
205+ 'application/json ' => new OA \MediaType (
206+ schema: new OA \Schema (
207+ properties: [
208+ new OA \Property (property: 'id ' , type: 'integer ' , example: 1 ),
209+ new OA \Property (property: 'name ' , type: 'string ' , example: 'Newsletter subscribers ' ),
210+ new OA \Property (
211+ property: 'description ' ,
212+ type: 'string ' ,
213+ example: 'Main public list ' ,
214+ nullable: true
215+ )
216+ ],
217+ type: 'object '
218+ )
219+ )
220+ ]
221+ ),
222+ new OA \Response (
223+ response: 404 ,
224+ description: 'Failure ' ,
225+ content: new OA \JsonContent (
226+ properties: [
227+ new OA \Property (
228+ property: 'message ' ,
229+ type: 'string ' ,
230+ example: 'There is no list with that ID. '
231+ )
232+ ],
233+ type: 'object '
234+ )
235+ ),
236+ ]
237+ )]
238+ public function getPublicList (#[MapEntity(mapping: ['listId ' => 'id ' ])] ?SubscriberList $ list = null ): JsonResponse
239+ {
240+ if (!$ list ) {
241+ throw $ this ->createNotFoundException ('Subscriber list not found. ' );
242+ }
243+
244+ return $ this ->json ([
245+ 'id ' => $ list ->getId (),
246+ 'name ' => $ list ->getName (),
247+ 'description ' => $ list ->getDescription (),
248+ ], Response::HTTP_OK );
249+ }
250+
184251 #[Route('/{listId} ' , name: 'delete ' , requirements: ['listId ' => '\d+ ' ], methods: ['DELETE ' ])]
185252 #[OA \Delete(
186253 path: '/api/v2/lists/{listId} ' ,
0 commit comments