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

Commit

Permalink
feat: Swagger options added (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyzwezdin authored Mar 31, 2024
1 parent 1fb7b2b commit eec9698
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
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

0 comments on commit eec9698

Please sign in to comment.