Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e68e30d

Browse files
committedJun 15, 2024·
orval/core - ignore "readonly" props
1 parent 341ab01 commit e68e30d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ export const getObject = ({
122122

123123
acc.hasReadonlyProps ||= isReadOnly || false;
124124
acc.imports.push(...resolvedValue.imports);
125-
acc.factoryMethodValue += `\n ${getKey(key)}: ${resolvedValue.factoryMethodValue},`;
125+
if (!isReadOnly || isRequired) {
126+
acc.factoryMethodValue += `\n ${getKey(key)}: ${resolvedValue.factoryMethodValue},`;
127+
}
126128
acc.value += `\n ${doc ? `${doc} ` : ''}${
127129
isReadOnly && !context.output.override.suppressReadonlyModifier
128130
? 'readonly '

0 commit comments

Comments
 (0)
Please sign in to comment.