Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime swagger document composer. #1001

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Runtime swagger document composer. #1001

merged 2 commits into from
Aug 27, 2024

Conversation

samchon
Copy link
Owner

@samchon samchon commented Aug 27, 2024

From now on, you can compose swagger documents in the runtime.

This is the way to do it.

Source Code

import { NestiaSwaggerComposer } from "@nestia/sdk";
import { INestApplication } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
import { SwaggerModule } from "@nestjs/swagger";

const bootstrap = async (): Promise<void> => {
  const app: INestApplication = await NestFactory.create(ApplicationModule);
  const document = await NestiaSwaggerComposer.document(app, {});
  SwaggerModule.setup("api", app, document as any);
  await app.listen(37_000);
};
bootstrap().catch(console.error);

tsconfig.json

{
  "compilerOptions": {
    "strict": true,
    "plugins": [
      { "transform": "typia/lib/transform" },
      { "transform": "@nestia/core/lib/transform" },
      { "transform": "@nestia/sdk/lib/transform" }, // essential
    ],
  },
}

@samchon samchon added the enhancement New feature or request label Aug 27, 2024
@samchon samchon self-assigned this Aug 27, 2024
Copy link

socket-security bot commented Aug 27, 2024

@samchon samchon merged commit 346dcb5 into master Aug 27, 2024
6 checks passed
Copy link
Owner Author

@samchon samchon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test completed.

@samchon samchon deleted the feature/embed branch August 27, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant