Skip to content

Commit 8f81611

Browse files
authored
Correcting Readme Example (#424)
you need the `.default`
1 parent 23ef7f6 commit 8f81611

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ npm i --save-dev openapi-typescript
9696

9797
```js
9898
const { readFileSync } = require("fs");
99-
const swaggerToTS = require("openapi-typescript");
99+
const swaggerToTS = require("openapi-typescript").default;
100100

101101
const input = JSON.parse(readFileSync("spec.json", "utf8")); // Input can be any JS object (OpenAPI format)
102102
const output = swaggerToTS(input); // Outputs TypeScript defs as a string (to be parsed, or written to a file)

0 commit comments

Comments
 (0)