fix(api): use snake_case for the last camelcase path params

This commit is contained in:
Hampus committed 2026-11-27 14:48:55 +01:00
1 parent d0ab1c56e7
commit 264e8f7b8a
5 files changed
+20 -20

No files matched your search

+2 -2
View File
@@ -369,7 +369,7 @@ export function OAuth2Controller(app: HonoApp) {
},
);
app.delete(
'/oauth2/@me/authorizations/:applicationId',
'/oauth2/@me/authorizations/:application_id',
RateLimitMiddleware(RateLimitConfigs.OAUTH_INTROSPECT),
LoginRequired,
DefaultUserOnly,
@@ -386,7 +386,7 @@ export function OAuth2Controller(app: HonoApp) {
}),
async (ctx) => {
const user = ctx.get('user');
const applicationId = ctx.req.valid('param').applicationId;
const applicationId = ctx.req.valid('param').application_id;
await ctx.get('oauth2RequestService').deleteAuthorization(user.id, applicationId);
return ctx.body(null, 204);
},
+8 -8
View File
@@ -11768,7 +11768,7 @@
]
}
},
"/harvest-downloads/{harvestId}": {
"/harvest-downloads/{harvest_id}": {
"get": {
"operationId": "download_data_harvest_archive",
"summary": "Download data harvest archive",
@@ -11816,7 +11816,7 @@
"description": "Streams a completed data harvest archive. Authorised by a signed, expiring token rather than a session, so the link works from the harvest completion email. Only active when presigned harvest downloads are disabled.",
"parameters": [
{
"name": "harvestId",
"name": "harvest_id",
"in": "path",
"required": true,
"schema": {"description": "The ID of the harvest request", "$ref": "#/components/schemas/SnowflakeType"},
@@ -12771,7 +12771,7 @@
}
}
},
"/oauth2/@me/authorizations/{applicationId}": {
"/oauth2/@me/authorizations/{application_id}": {
"delete": {
"operationId": "delete_user_oauth2_authorization",
"summary": "Revoke OAuth2 authorization",
@@ -12821,7 +12821,7 @@
"security": [{"sessionToken": []}],
"parameters": [
{
"name": "applicationId",
"name": "application_id",
"in": "path",
"required": true,
"schema": {"description": "The ID of the application", "$ref": "#/components/schemas/SnowflakeType"},
@@ -21239,7 +21239,7 @@
"security": [{"sessionToken": []}]
}
},
"/users/@me/harvest/{harvestId}": {
"/users/@me/harvest/{harvest_id}": {
"get": {
"operationId": "get_data_harvest_status",
"summary": "Get data harvest status",
@@ -21292,7 +21292,7 @@
"security": [{"sessionToken": []}],
"parameters": [
{
"name": "harvestId",
"name": "harvest_id",
"in": "path",
"required": true,
"schema": {"description": "The ID of the harvest request", "$ref": "#/components/schemas/SnowflakeType"},
@@ -21301,7 +21301,7 @@
]
}
},
"/users/@me/harvest/{harvestId}/download": {
"/users/@me/harvest/{harvest_id}/download": {
"get": {
"operationId": "get_data_harvest_download_url",
"summary": "Get data harvest download URL",
@@ -21354,7 +21354,7 @@
"security": [{"sessionToken": []}],
"parameters": [
{
"name": "harvestId",
"name": "harvest_id",
"in": "path",
"required": true,
"schema": {"description": "The ID of the harvest request", "$ref": "#/components/schemas/SnowflakeType"},
@@ -253,7 +253,7 @@ export function UserContentController(app: HonoApp) {
},
);
app.get(
'/users/@me/harvest/:harvestId',
'/users/@me/harvest/:harvest_id',
RateLimitMiddleware(RateLimitConfigs.USER_HARVEST_STATUS),
LoginRequired,
DefaultUserOnly,
@@ -269,7 +269,7 @@ export function UserContentController(app: HonoApp) {
'Retrieves detailed status information for a specific data harvest. Shows progress, completion status, and other metadata about the harvest request.',
}),
async (ctx) => {
const {harvestId} = ctx.req.valid('param');
const {harvest_id: harvestId} = ctx.req.valid('param');
const harvest = await ctx.get('userContentRequestService').getHarvestStatus({
userId: ctx.get('user').id,
harvestId,
@@ -278,7 +278,7 @@ export function UserContentController(app: HonoApp) {
},
);
app.get(
'/harvest-downloads/:harvestId',
'/harvest-downloads/:harvest_id',
RateLimitMiddleware(RateLimitConfigs.USER_HARVEST_DOWNLOAD_FILE),
Validator('param', HarvestIdParam),
Validator('query', HarvestDownloadQuery, (result, ctx) =>
@@ -296,7 +296,7 @@ export function UserContentController(app: HonoApp) {
'Streams a completed data harvest archive. Authorised by a signed, expiring token rather than a session, so the link works from the harvest completion email. Only active when presigned harvest downloads are disabled.',
}),
async (ctx) => {
const {harvestId} = ctx.req.valid('param');
const {harvest_id: harvestId} = ctx.req.valid('param');
const {token} = ctx.req.valid('query');
try {
const result = await ctx.get('userContentRequestService').streamHarvestDownload({
@@ -330,7 +330,7 @@ export function UserContentController(app: HonoApp) {
},
);
app.get(
'/users/@me/harvest/:harvestId/download',
'/users/@me/harvest/:harvest_id/download',
RateLimitMiddleware(RateLimitConfigs.USER_HARVEST_DOWNLOAD),
LoginRequired,
DefaultUserOnly,
@@ -346,7 +346,7 @@ export function UserContentController(app: HonoApp) {
'Retrieves the download URL for a completed data harvest. The URL is temporary and expires after a set time. Can only be accessed for completed harvests.',
}),
async (ctx) => {
const {harvestId} = ctx.req.valid('param');
const {harvest_id: harvestId} = ctx.req.valid('param');
const result = await ctx.get('userContentRequestService').getHarvestDownloadUrl({
userId: ctx.get('user').id,
harvestId,
@@ -287,8 +287,8 @@ describe('Date of birth gate route coverage', () => {
'GET /experiments',
'GET /gateway/bot',
'GET /users/@me',
'GET /users/@me/harvest/:harvestId',
'GET /users/@me/harvest/:harvestId/download',
'GET /users/@me/harvest/:harvest_id',
'GET /users/@me/harvest/:harvest_id/download',
'GET /users/@me/harvest/latest',
'GET /users/@me/settings',
'GET /users/@me/sudo/mfa-methods',
@@ -101,7 +101,7 @@ export const TargetIdParam = z.object({
export type TargetIdParam = z.infer<typeof TargetIdParam>;
export const ApplicationAuthorizationIdParam = z.object({
applicationId: SnowflakeType.describe('The ID of the application'),
application_id: SnowflakeType.describe('The ID of the application'),
});
export type ApplicationAuthorizationIdParam = z.infer<typeof ApplicationAuthorizationIdParam>;
@@ -199,7 +199,7 @@ export const JobIdParam = z.object({
export type JobIdParam = z.infer<typeof JobIdParam>;
export const HarvestIdParam = z.object({
harvestId: SnowflakeType.describe('The ID of the harvest request'),
harvest_id: SnowflakeType.describe('The ID of the harvest request'),
});
export type HarvestIdParam = z.infer<typeof HarvestIdParam>;