Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

featSwagger options added #2

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/rejs-swagger/src/options.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { OpenAPIObjectConfig } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator'
import { UrlSchema } from '@relab/rejs'

export type SwaggerOptions = {
path?: UrlSchema
version?: string
title?: string
description?: string
options?: OpenAPIObjectConfig
ui?:
| {
enabled: true
Expand Down
1 change: 1 addition & 0 deletions packages/rejs-swagger/src/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const swagger: (options?: SwaggerOptions) => Middleware = options => conf
.status(200)
.send(
generator.generateDocument({
...(options?.options ?? {}),
openapi: '3.0.0',
info: {
version: options?.version ?? '',
Expand Down