mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
chore(server): sort open api params (#6484)
* chore: sort spec * chore: open api * chore(mobile): sort auditDeletes params --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
bd2dbb4944
commit
7b314f9435
@ -53,7 +53,7 @@ class AssetService {
|
||||
Future<(List<Asset>? toUpsert, List<String>? toDelete)>
|
||||
_getRemoteAssetChanges(User user, DateTime since) async {
|
||||
final deleted = await _apiService.auditApi
|
||||
.getAuditDeletes(EntityType.ASSET, since, userId: user.id);
|
||||
.getAuditDeletes(since, EntityType.ASSET, userId: user.id);
|
||||
if (deleted == null || deleted.needsFullSync) return (null, null);
|
||||
final assetDto = await _apiService.assetApi
|
||||
.getAllAssets(userId: user.id, updatedAfter: since);
|
||||
|
BIN
mobile/openapi/doc/ActivityApi.md
generated
BIN
mobile/openapi/doc/ActivityApi.md
generated
Binary file not shown.
BIN
mobile/openapi/doc/AlbumApi.md
generated
BIN
mobile/openapi/doc/AlbumApi.md
generated
Binary file not shown.
BIN
mobile/openapi/doc/AssetApi.md
generated
BIN
mobile/openapi/doc/AssetApi.md
generated
Binary file not shown.
BIN
mobile/openapi/doc/AuditApi.md
generated
BIN
mobile/openapi/doc/AuditApi.md
generated
Binary file not shown.
BIN
mobile/openapi/doc/SearchApi.md
generated
BIN
mobile/openapi/doc/SearchApi.md
generated
Binary file not shown.
BIN
mobile/openapi/doc/SharedLinkApi.md
generated
BIN
mobile/openapi/doc/SharedLinkApi.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/activity_api.dart
generated
BIN
mobile/openapi/lib/api/activity_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/album_api.dart
generated
BIN
mobile/openapi/lib/api/album_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/asset_api.dart
generated
BIN
mobile/openapi/lib/api/asset_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/audit_api.dart
generated
BIN
mobile/openapi/lib/api/audit_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/search_api.dart
generated
BIN
mobile/openapi/lib/api/search_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/shared_link_api.dart
generated
BIN
mobile/openapi/lib/api/shared_link_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/activity_api_test.dart
generated
BIN
mobile/openapi/test/activity_api_test.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/album_api_test.dart
generated
BIN
mobile/openapi/test/album_api_test.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/asset_api_test.dart
generated
BIN
mobile/openapi/test/asset_api_test.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/audit_api_test.dart
generated
BIN
mobile/openapi/test/audit_api_test.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/search_api_test.dart
generated
BIN
mobile/openapi/test/search_api_test.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/shared_link_api_test.dart
generated
BIN
mobile/openapi/test/shared_link_api_test.dart
generated
Binary file not shown.
File diff suppressed because it is too large
Load Diff
1206
open-api/typescript-sdk/client/api.ts
generated
1206
open-api/typescript-sdk/client/api.ts
generated
File diff suppressed because it is too large
Load Diff
@ -20,10 +20,12 @@ import {
|
||||
import { NextFunction, Response } from 'express';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { access, constants } from 'fs/promises';
|
||||
import _ from 'lodash';
|
||||
import path, { isAbsolute } from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import { applyDecorators, UsePipes, ValidationPipe } from '@nestjs/common';
|
||||
import { SchemaObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
||||
import { Metadata } from './app.guard';
|
||||
|
||||
export function UseValidation() {
|
||||
@ -110,8 +112,21 @@ export const routeToErrorMessage = (methodName: string) =>
|
||||
|
||||
const patchOpenAPI = (document: OpenAPIObject) => {
|
||||
document.paths = sortKeys(document.paths);
|
||||
|
||||
if (document.components?.schemas) {
|
||||
document.components.schemas = sortKeys(document.components.schemas);
|
||||
const schemas = document.components.schemas as Record<string, SchemaObject>;
|
||||
|
||||
document.components.schemas = sortKeys(schemas);
|
||||
|
||||
for (const schema of Object.values(schemas)) {
|
||||
if (schema.properties) {
|
||||
schema.properties = sortKeys(schema.properties);
|
||||
}
|
||||
|
||||
if (schema.required) {
|
||||
schema.required = schema.required.sort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(document.paths)) {
|
||||
@ -152,6 +167,10 @@ const patchOpenAPI = (document: OpenAPIObject) => {
|
||||
if (operation.description === '') {
|
||||
delete operation.description;
|
||||
}
|
||||
|
||||
if (operation.parameters) {
|
||||
operation.parameters = _.orderBy(operation.parameters, 'name');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user