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 Jun 15, 2024
1 parent 341ab01 commit e68e30d
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 e68e30d

Please sign in to comment.