Skip to content

Commit

Permalink
fix(docs): move a few API doc comments to descriptions (#15381)
Browse files Browse the repository at this point in the history
Previously, the comments were being used as the summaries, and thus were
displayed as the “title” of these endpoints
bencochran authored Jan 29, 2025

Verified

This commit was signed with the committer’s verified signature.
shikanime Shikanime Deva
1 parent a0aea02 commit b4a4abb
Showing 6 changed files with 50 additions and 14 deletions.
8 changes: 4 additions & 4 deletions mobile/openapi/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions mobile/openapi/lib/api/assets_api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
@@ -1424,6 +1424,7 @@
},
"/assets/bulk-upload-check": {
"post": {
"description": "Checks if assets exist by checksums",
"operationId": "checkBulkUpload",
"parameters": [],
"requestBody": {
@@ -1459,14 +1460,15 @@
"api_key": []
}
],
"summary": "Checks if assets exist by checksums",
"summary": "checkBulkUpload",
"tags": [
"Assets"
]
}
},
"/assets/device/{deviceId}": {
"get": {
"description": "Get all asset of a device that are in the database, ID only.",
"operationId": "getAllUserAssetsByDeviceId",
"parameters": [
{
@@ -1504,14 +1506,15 @@
"api_key": []
}
],
"summary": "Get all asset of a device that are in the database, ID only.",
"summary": "getAllUserAssetsByDeviceId",
"tags": [
"Assets"
]
}
},
"/assets/exist": {
"post": {
"description": "Checks if multiple assets exist on the server and returns all existing - used by background backup",
"operationId": "checkExistingAssets",
"parameters": [],
"requestBody": {
@@ -1547,7 +1550,7 @@
"api_key": []
}
],
"summary": "Checks if multiple assets exist on the server and returns all existing - used by background backup",
"summary": "checkExistingAssets",
"tags": [
"Assets"
]
@@ -1903,6 +1906,7 @@
]
},
"put": {
"description": "Replace the asset with new file, without changing its id",
"operationId": "replaceAsset",
"parameters": [
{
@@ -1956,7 +1960,7 @@
"api_key": []
}
],
"summary": "Replace the asset with new file, without changing its id",
"summary": "replaceAsset",
"tags": [
"Assets"
],
8 changes: 4 additions & 4 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
@@ -1703,7 +1703,7 @@ export function updateAssets({ assetBulkUpdateDto }: {
})));
}
/**
* Checks if assets exist by checksums
* checkBulkUpload
*/
export function checkBulkUpload({ assetBulkUploadCheckDto }: {
assetBulkUploadCheckDto: AssetBulkUploadCheckDto;
@@ -1718,7 +1718,7 @@ export function checkBulkUpload({ assetBulkUploadCheckDto }: {
})));
}
/**
* Get all asset of a device that are in the database, ID only.
* getAllUserAssetsByDeviceId
*/
export function getAllUserAssetsByDeviceId({ deviceId }: {
deviceId: string;
@@ -1731,7 +1731,7 @@ export function getAllUserAssetsByDeviceId({ deviceId }: {
}));
}
/**
* Checks if multiple assets exist on the server and returns all existing - used by background backup
* checkExistingAssets
*/
export function checkExistingAssets({ checkExistingAssetsDto }: {
checkExistingAssetsDto: CheckExistingAssetsDto;
@@ -1839,7 +1839,7 @@ export function downloadAsset({ id, key }: {
}));
}
/**
* Replace the asset with new file, without changing its id
* replaceAsset
*/
export function replaceAsset({ id, key, assetMediaReplaceDto }: {
id: string;
14 changes: 13 additions & 1 deletion server/src/controllers/asset-media.controller.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import {
UploadedFiles,
UseInterceptors,
} from '@nestjs/common';
import { ApiBody, ApiConsumes, ApiHeader, ApiTags } from '@nestjs/swagger';
import { ApiBody, ApiConsumes, ApiHeader, ApiOperation, ApiTags } from '@nestjs/swagger';
import { NextFunction, Response } from 'express';
import { EndpointLifecycle } from 'src/decorators';
import {
@@ -94,6 +94,10 @@ export class AssetMediaController {
@UseInterceptors(FileUploadInterceptor)
@ApiConsumes('multipart/form-data')
@EndpointLifecycle({ addedAt: 'v1.106.0' })
@ApiOperation({
summary: 'replaceAsset',
description: 'Replace the asset with new file, without changing its id',
})
@Authenticated({ sharedLink: true })
async replaceAsset(
@Auth() auth: AuthDto,
@@ -141,6 +145,10 @@ export class AssetMediaController {
*/
@Post('exist')
@HttpCode(HttpStatus.OK)
@ApiOperation({
summary: 'checkExistingAssets',
description: 'Checks if multiple assets exist on the server and returns all existing - used by background backup',
})
@Authenticated()
checkExistingAssets(
@Auth() auth: AuthDto,
@@ -154,6 +162,10 @@ export class AssetMediaController {
*/
@Post('bulk-upload-check')
@HttpCode(HttpStatus.OK)
@ApiOperation({
summary: 'checkBulkUpload',
description: 'Checks if assets exist by checksums',
})
@Authenticated()
checkBulkUpload(
@Auth() auth: AuthDto,
6 changes: 5 additions & 1 deletion server/src/controllers/asset.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { EndpointLifecycle } from 'src/decorators';
import { AssetResponseDto, MemoryLaneResponseDto } from 'src/dtos/asset-response.dto';
import {
@@ -41,6 +41,10 @@ export class AssetController {
* Get all asset of a device that are in the database, ID only.
*/
@Get('/device/:deviceId')
@ApiOperation({
summary: 'getAllUserAssetsByDeviceId',
description: 'Get all asset of a device that are in the database, ID only.',
})
@Authenticated()
getAllUserAssetsByDeviceId(@Auth() auth: AuthDto, @Param() { deviceId }: DeviceIdDto) {
return this.service.getUserAssetsByDeviceId(auth, deviceId);

0 comments on commit b4a4abb

Please sign in to comment.