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 May 22, 2024
1 parent b71391a commit 32e6fab
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 @@ -122,7 +122,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 32e6fab

Please sign in to comment.