Skip to content

Commit

Permalink
feat: make params on patch optional
Browse files Browse the repository at this point in the history
  • Loading branch information
wahyubucil committed Oct 31, 2023
1 parent d798e1d commit 2d4fb30
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/patch-nest-swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,25 @@ interface Type<T = any> extends Function {
}

interface Options {
sort: 'default' | 'alpha' | 'localeCompare'
/** @default default */
sort?: 'default' | 'alpha' | 'localeCompare'
}

interface Modules {
schemaObjectFactoryModule?: typeof import('@nestjs/swagger/dist/services/schema-object-factory')
swaggerScannerModule?: typeof import('@nestjs/swagger/dist/swagger-scanner')
}

export function patchNestjsSwagger(
{ sort = 'default' }: Options,
{
options: Options = {},
modules: Modules = {},
) {
const { sort = 'default' } = options
const {
schemaObjectFactoryModule = require('@nestjs/swagger/dist/services/schema-object-factory'),
swaggerScannerModule = require('@nestjs/swagger/dist/swagger-scanner'),
},
) {
} = modules

const registry = new OpenAPIRegistry()

/**
Expand Down

0 comments on commit 2d4fb30

Please # to comment.