mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: add header swagger docs
This commit is contained in:
20
packages/server/src/common/decorators/ApiCommonHeaders.ts
Normal file
20
packages/server/src/common/decorators/ApiCommonHeaders.ts
Normal 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,
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user