Skip to content

Commit c2fd11e

Browse files
danmichaelokerwanp
authored andcommitted
fix(docs): createTypeReferenceNode in transform examples (openapi-ts#1753)
1 parent dd12b70 commit c2fd11e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/node.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ By default, openapiTS will generate `updated_at?: string;` because it’s not su
116116
import openapiTS from "openapi-typescript";
117117
import ts from "typescript";
118118
119-
const DATE = ts.factory.createIdentifier("Date"); // `Date`
119+
const DATE = ts.factory.createTypeReferenceNode(ts.factory.createIdentifier("Date")); // `Date`
120120
const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull()); // `null`
121121

122122
const ast = await openapiTS(mySchema, {
@@ -168,7 +168,7 @@ Use the same pattern to transform the types:
168168
import openapiTS from "openapi-typescript";
169169
import ts from "typescript";
170170
171-
const BLOB = ts.factory.createIdentifier("Blob"); // `Blob`
171+
const BLOB = ts.factory.createTypeReferenceNode(ts.factory.createIdentifier("Blob")); // `Blob`
172172
const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull()); // `null`
173173

174174
const ast = await openapiTS(mySchema, {
@@ -221,7 +221,7 @@ Here we return an object with a schema property, which is the same as the above
221221
import openapiTS from "openapi-typescript";
222222
import ts from "typescript";
223223
224-
const BLOB = ts.factory.createIdentifier("Blob"); // `Blob`
224+
const BLOB = ts.factory.createTypeReferenceNode(ts.factory.createIdentifier("Blob")); // `Blob`
225225
const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull()); // `null`
226226

227227
const ast = await openapiTS(mySchema, {

0 commit comments

Comments
 (0)