Skip to content

Commit 97552e4

Browse files
authoredFeb 13, 2024
fix(core): implement {} insterd of unknown for blank schema interface (#1219)
1 parent e528e11 commit 97552e4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎packages/core/src/getters/object.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,16 @@ export const getObject = ({
202202
};
203203
}
204204

205+
const useTypeOverInterfaces = context?.output.override?.useTypeOverInterfaces;
206+
const blankValue =
207+
item.type === 'object'
208+
? '{ [key: string]: any }'
209+
: useTypeOverInterfaces
210+
? 'unknown'
211+
: '{}';
212+
205213
return {
206-
value:
207-
(item.type === 'object' ? '{ [key: string]: any }' : 'unknown') +
208-
nullable,
214+
value: blankValue + nullable,
209215
imports: [],
210216
schemas: [],
211217
isEnum: false,

0 commit comments

Comments
 (0)
Please sign in to comment.