test: sync open api spec (#9687)

test: sync spec file
This commit is contained in:
Jason Rasmussen 2024-05-23 07:40:57 -04:00 committed by GitHub
parent a5e8b451b2
commit e7aa50425c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 45 additions and 16 deletions

View file

@ -174,7 +174,7 @@ const patchOpenAPI = (document: OpenAPIObject) => {
return document;
};
export const useSwagger = (app: INestApplication) => {
export const useSwagger = (app: INestApplication, force = false) => {
const config = new DocumentBuilder()
.setTitle('Immich')
.setDescription('Immich API')
@ -211,7 +211,7 @@ export const useSwagger = (app: INestApplication) => {
SwaggerModule.setup('doc', app, specification, customOptions);
if (isDev()) {
if (isDev() || force) {
// Generate API Documentation only in development mode
const outputPath = path.resolve(process.cwd(), '../open-api/immich-openapi-specs.json');
writeFileSync(outputPath, JSON.stringify(patchOpenAPI(specification), null, 2), { encoding: 'utf8' });