feat: add header swagger docs

This commit is contained in:
Ahmed Bouhuolia
2025-07-02 17:42:17 +02:00
parent b2d61160dd
commit 456a9e1ad9
65 changed files with 172 additions and 48 deletions

View File

@@ -0,0 +1,20 @@
import { applyDecorators } from '@nestjs/common';
import { ApiHeader } from '@nestjs/swagger';
export function ApiCommonHeaders() {
return applyDecorators(
ApiHeader({
name: 'Authorization',
description:
"Value must be 'Bearer <token>' where <token> is an API key prefixed with 'bc_' or a JWT token.",
schema: { type: 'string', example: 'Bearer bc_1234567890abcdef' },
required: true,
}),
ApiHeader({
name: 'organization-id',
description:
'Required if Authorization is a JWT token. The organization ID to operate within.',
required: true,
}),
);
}