Skip to content

Commit

Permalink
orval/core - ignore "readonly" props
Browse files Browse the repository at this point in the history
  • Loading branch information
mironbalcerzak committed Nov 16, 2024
1 parent 0174896 commit 71e74f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/getters/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export const getObject = ({

acc.hasReadonlyProps ||= isReadOnly || false;
acc.imports.push(...resolvedValue.imports);
acc.factoryMethodValue += `\n ${getKey(key)}: ${resolvedValue.factoryMethodValue},`;
if (!isReadOnly || isRequired) {
acc.factoryMethodValue += `\n ${getKey(key)}: ${resolvedValue.factoryMethodValue},`;
}
acc.value += `\n ${doc ? `${doc} ` : ''}${
isReadOnly && !context.output.override.suppressReadonlyModifier
? 'readonly '
Expand Down

0 comments on commit 71e74f6

Please sign in to comment.