Skip to content

Commit

Permalink
renamed swagger to oas and updated doc-check
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvuka1 committed Feb 12, 2024
1 parent cc3cebc commit 5cdddad
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 27 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/doc-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@ jobs:
id: checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Install Dependencies
id: bun-install
run: bun install --frozen-lockfile

- name: Save OpenAPI Specification
id: bun-save-oas
run: bun save-oas

- name: Check Documentaiton
id: doc-check
uses: alexvuka1/doc-check@d06cb7b25c4f6f4e63c5fd2b97c9d655d983ee88
uses: alexvuka1/doc-check@e4fb43620b1cd4bd6e06b37aa00c140ceaea0bff
with:
str: 'World'

- name: Print Output
id: output
run: echo "${{ steps.doc-check.outputs.time }}"
openapi-path: ${{ github.workspace }}/openapi.json
doc-path: ${{ github.workspace }}/docs/api.md
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all"
"trailingComma": "all",
"tabWidth": 2
}
1 change: 0 additions & 1 deletion assets/swagger.json

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"save-swagger": "bun src/saveSwagger.ts",
"save-oas": "bun src/saveOAS.ts",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
},
"dependencies": {
Expand Down
18 changes: 18 additions & 0 deletions src/saveOAS.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { writeFileSync } from 'fs';

const saveOAS = async () => {
const app = await NestFactory.create(AppModule);

const config = new DocumentBuilder()
.setTitle('doc-check-demo')
.setDescription('The doc-check-demo API description')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);

writeFileSync('./openapi.json', JSON.stringify(document));
};
saveOAS();
18 changes: 0 additions & 18 deletions src/saveSwagger.ts

This file was deleted.

0 comments on commit 5cdddad

Please sign in to comment.