mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced the API specification generation process to include operation IDs, security schemes, and security definitions more efficiently. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lucas Smith <me@lucasjamessmith.me>
36 lines
675 B
TypeScript
36 lines
675 B
TypeScript
import { generateOpenApi } from '@ts-rest/open-api';
|
|
|
|
import { ApiContractV1 } from './contract';
|
|
|
|
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,
|
|
},
|
|
),
|
|
{
|
|
components: {
|
|
securitySchemes: {
|
|
authorization: {
|
|
type: 'apiKey',
|
|
in: 'header',
|
|
name: 'Authorization',
|
|
},
|
|
},
|
|
},
|
|
security: [
|
|
{
|
|
authorization: [],
|
|
},
|
|
],
|
|
},
|
|
);
|