Skip to content

Commit dfe55a2

Browse files
committed
read converted dist/openapi.json file directly instead of converting twice
1 parent 9ce4988 commit dfe55a2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/typegen.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
const fs = require('fs')
22

3-
const converter = require('swagger2openapi')
4-
53
async function typegen() {
64
const openapiTS = (await import('openapi-typescript')).default
7-
const swaggerYmlString = fs.readFileSync('external.yml', 'utf-8')
8-
const { openapi } = await converter.convertStr(swaggerYmlString, {})
5+
const openapiJsonString = fs.readFileSync('dist/openapi.json', 'utf-8')
6+
const openapi = JSON.parse(openapiJsonString)
97

108
addDocsLinksToOperationDescriptions(openapi)
119

0 commit comments

Comments
 (0)