@@ -181,6 +181,59 @@ 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+
206+ ]
207+ ),
208+ new OA \Response (
209+ response: 404 ,
210+ description: 'Failure ' ,
211+ content: new OA \JsonContent (
212+ properties: [
213+ new OA \Property (
214+ property: 'message ' ,
215+ type: 'string ' ,
216+ example: 'There is no list with that ID. '
217+ )
218+ ],
219+ type: 'object '
220+ )
221+ ),
222+ ]
223+ )]
224+ public function getPublicList (#[MapEntity(mapping: ['listId ' => 'id ' ])] ?SubscriberList $ list = null ): JsonResponse
225+ {
226+ if (!$ list ) {
227+ throw $ this ->createNotFoundException ('Subscriber list not found. ' );
228+ }
229+
230+ return $ this ->json ([
231+ 'id ' => $ list ->getId (),
232+ 'name ' => $ list ->getName (),
233+ 'description ' => $ list ->getDescription (),
234+ ], Response::HTTP_OK );
235+ }
236+
184237 #[Route('/{listId} ' , name: 'delete ' , requirements: ['listId ' => '\d+ ' ], methods: ['DELETE ' ])]
185238 #[OA \Delete(
186239 path: '/api/v2/lists/{listId} ' ,
0 commit comments