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
  • Loading branch information
bencochran authored Jan 29, 2025
1 parent a0aea02 commit b4a4abb
Show file tree
Hide file tree
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
Expand Up @@ -1424,6 +1424,7 @@
},
"/assets/bulk-upload-check": {
"post": {
"description": "Checks if assets exist by checksums",
"operationId": "checkBulkUpload",
"parameters": [],
"requestBody": {
Expand Down Expand Up @@ -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": [
{
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
]
Expand Down Expand Up @@ -1903,6 +1906,7 @@
]
},
"put": {
"description": "Replace the asset with new file, without changing its id",
"operationId": "replaceAsset",
"parameters": [
{
Expand Down Expand Up @@ -1956,7 +1960,7 @@
"api_key": []
}
],
"summary": "Replace the asset with new file, without changing its id",
"summary": "replaceAsset",
"tags": [
"Assets"
],
Expand Down
8 changes: 4 additions & 4 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ export function updateAssets({ assetBulkUpdateDto }: {
})));
}
/**
* Checks if assets exist by checksums
* checkBulkUpload
*/
export function checkBulkUpload({ assetBulkUploadCheckDto }: {
assetBulkUploadCheckDto: AssetBulkUploadCheckDto;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 13 additions & 1 deletion server/src/controllers/asset-media.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b4a4abb

Please sign in to comment.