mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	chore: sort open api spec keys (#2710)
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -21,7 +21,25 @@ export const handleDownload = (download: DownloadArchive, res: Response) => { | ||||
|   return download.stream; | ||||
| }; | ||||
|  | ||||
| function sortKeys<T extends object>(obj: T): T { | ||||
|   if (!obj) { | ||||
|     return obj; | ||||
|   } | ||||
|  | ||||
|   const result: Partial<T> = {}; | ||||
|   const keys = Object.keys(obj).sort() as Array<keyof T>; | ||||
|   for (const key of keys) { | ||||
|     result[key] = obj[key]; | ||||
|   } | ||||
|   return result as T; | ||||
| } | ||||
|  | ||||
| const patchOpenAPI = (document: OpenAPIObject) => { | ||||
|   document.paths = sortKeys(document.paths); | ||||
|   if (document.components?.schemas) { | ||||
|     document.components.schemas = sortKeys(document.components.schemas); | ||||
|   } | ||||
|  | ||||
|   for (const path of Object.values(document.paths)) { | ||||
|     const operations = { | ||||
|       get: path.get, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user