Skip to content

Commit

Permalink
Merge pull request #28 from vodyani/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
ChoGathK authored Sep 24, 2022
2 parents 76ae04e + 8ca158b commit 7b51b18
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 34 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [8.2.0-beta.1](https://github.com/vodyani/swagger/compare/v8.1.4...v8.2.0-beta.1) (2022-09-24)


### Features

* remove custom registration decorators and reduce base dependencies ([642fcbd](https://github.com/vodyani/swagger/commit/642fcbdfd1cf097dc5bd073df08de052dbeea9ef))

## [8.1.4](https://github.com/vodyani/swagger/compare/v8.1.3...v8.1.4) (2022-09-07)


Expand Down
55 changes: 35 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@vodyani/swagger",
"license": "MIT",
"version": "8.1.4",
"version": "8.2.0-beta.1",
"author": "ChoGathK",
"description": "swagger",
"homepage": "https://github.com/vodyani/swagger#readme",
Expand Down Expand Up @@ -63,8 +63,9 @@
]
},
"dependencies": {
"@nestjs/common": "^8.4.7",
"@nestjs/swagger": "5.2.1",
"@vodyani/core": "^8.7.1",
"@vodyani/core": "^8.8.0",
"@vodyani/utils": "^8.5.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/decorator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Type, applyDecorators } from '@vodyani/core';
import { Type, applyDecorators } from '@nestjs/common';
import { ApiBody, ApiConsumes, ApiOkResponse, getSchemaPath } from '@nestjs/swagger';

import { ExtraModelStore } from './struct';
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from '@nestjs/swagger';

export { SwaggerModule } from './module';

export * from './decorator';
export * from './module';
export * from './provider';
export * from './struct';
10 changes: 5 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Infrastructure } from '@vodyani/core';
import { Module } from '@nestjs/common';

import { SwaggerProvider } from './provider';

@Infrastructure({
provider: [SwaggerProvider],
export: [SwaggerProvider],
@Module({
providers: [SwaggerProvider],
exports: [SwaggerProvider],
})
export class SwaggerInfrastructure {}
export class SwaggerModule {}

8 changes: 4 additions & 4 deletions src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable, INestApplication } from '@vodyani/core';
import { SwaggerDocumentOptions, SwaggerModule, OpenAPIObject, DocumentBuilder } from '@nestjs/swagger';
import { Injectable, INestApplication } from '@nestjs/common';
import { SwaggerDocumentOptions, SwaggerModule as Swagger, OpenAPIObject, DocumentBuilder } from '@nestjs/swagger';

import { ExtraModelStore } from './struct';

Expand All @@ -15,12 +15,12 @@ export class SwaggerProvider {
config: Omit<OpenAPIObject, 'paths'>,
options?: SwaggerDocumentOptions,
) {
const document = SwaggerModule.createDocument(
const document = Swagger.createDocument(
application,
config,
{ extraModels: ExtraModelStore.get(), ...options },
);

SwaggerModule.setup(path, application, document);
Swagger.setup(path, application, document);
}
}
2 changes: 1 addition & 1 deletion src/struct.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Type } from '@vodyani/core';
import { Type } from '@nestjs/common';

export class ExtraModelStore {
private static readonly store: Map<string, Type> = new Map();
Expand Down

0 comments on commit 7b51b18

Please sign in to comment.