From 45de8ceae0e28f00a88375064e5b3208d06924a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Wed, 21 Aug 2024 13:01:00 +0200 Subject: [PATCH] chore: type our path parameters when they are numbers (#4471) Path types in our openapi are inferred as string (which is a sensible default). But we can be more specific and provide the right type for each parameter. This is one example of how we can do that --- src/lib/routes/admin-api/user-admin.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/routes/admin-api/user-admin.ts b/src/lib/routes/admin-api/user-admin.ts index 0f9e2448cf3e..ac0025d15837 100644 --- a/src/lib/routes/admin-api/user-admin.ts +++ b/src/lib/routes/admin-api/user-admin.ts @@ -363,6 +363,15 @@ export default class UserAdminController extends Controller { description: 'Only the explicitly specified fields get updated.', requestBody: createRequestSchema('updateUserSchema'), + parameters: [ + { + name: 'id', + in: 'path', + schema: { + type: 'integer', + }, + }, + ], responses: { 200: createResponseSchema('createUserResponseSchema'), ...getStandardResponses(400, 401, 403, 404),