Skip to content

Commit

Permalink
chore: type our path parameters when they are numbers (#4471)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gastonfournier authored Aug 21, 2024
1 parent df73c65 commit 45de8ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/routes/admin-api/user-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 45de8ce

Please sign in to comment.