Skip to content

Commit b4f2d10

Browse files
committed
fix: correct fieldPath when generating model jsdoc
1 parent 2c2393d commit b4f2d10

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/schema-to-typescript/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export function generateSchemaType({
199199
tsTypeLiteral(
200200
Object.entries(schema.properties).map(([fieldName, fieldSchema]) => {
201201
let jsdoc = extractJsDoc(fieldSchema);
202-
const currentProcessJsDocPath = processJsDocPath ?? [];
202+
const currentProcessJsDocPath = (processJsDocPath ?? []).concat(fieldName);
203203
if (processJsDoc) {
204204
jsdoc = processJsDoc(jsdoc, fieldSchema, currentProcessJsDocPath);
205205
}
@@ -211,7 +211,7 @@ export function generateSchemaType({
211211
generateSchemaType({
212212
schema: fieldSchema,
213213
...commonSchemaGenerationOptions,
214-
processJsDocPath: currentProcessJsDocPath.concat(fieldName)
214+
processJsDocPath: currentProcessJsDocPath
215215
})
216216
)
217217
),

0 commit comments

Comments
 (0)