Skip to content

The Open Source DocuSign Alternative.

fix: swagger documentation authentication (#1037)

Catalin Pit0f87dc047b47
diff --git a/packages/api/v1/openapi.ts b/packages/api/v1/openapi.ts
index af0582195..55ec4d7fd 100644
--- a/packages/api/v1/openapi.ts
+++ b/packages/api/v1/openapi.ts
@@ -2,16 +2,34 @@ import { generateOpenApi } from '@ts-rest/open-api';
import { ApiContractV1 } from './contract';
-export const OpenAPIV1 = generateOpenApi(
- ApiContractV1,
- {
- info: {
- title: 'Documenso API',
- version: '1.0.0',
- description: 'The Documenso API for retrieving, creating, updating and deleting documents.',
+export const OpenAPIV1 = Object.assign(
+ generateOpenApi(
+ ApiContractV1,
+ {
+ info: {
+ title: 'Documenso API',
+ version: '1.0.0',
+ description: 'The Documenso API for retrieving, creating, updating and deleting documents.',
+ },
},
- },
+ {
+ setOperationId: true,
+ },
+ ),
{
- setOperationId: true,
+ components: {
+ securitySchemes: {
+ authorization: {
+ type: 'apiKey',
+ in: 'header',
+ name: 'Authorization',
+ },
+ },
+ },
+ security: [
+ {
+ authorization: [],
+ },
+ ],
},
);