diff --git a/packages/core/src/getters/array.ts b/packages/core/src/getters/array.ts index 368735422..7202001d2 100644 --- a/packages/core/src/getters/array.ts +++ b/packages/core/src/getters/array.ts @@ -20,7 +20,7 @@ export const getArray = ({ if (schema.items) { const resolvedObject = resolveObject({ schema: schema.items, - propName: name + 'Item', + propName: name + context.override.components.schemas.itemSuffix, context, }); return { diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 933b62687..e85e4730d 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -79,6 +79,7 @@ export type NormalizedOverrideOutput = { components: { schemas: { suffix: string; + itemSuffix: string; }; responses: { suffix: string; @@ -285,6 +286,7 @@ export type OverrideOutput = { components?: { schemas?: { suffix?: string; + itemSuffix?: string; }; responses?: { suffix?: string; diff --git a/packages/orval/src/utils/options.ts b/packages/orval/src/utils/options.ts index 10ce3380c..e40b1a602 100644 --- a/packages/orval/src/utils/options.ts +++ b/packages/orval/src/utils/options.ts @@ -182,6 +182,8 @@ export const normalizeOptions = async ( components: { schemas: { suffix: RefComponentSuffix.schemas, + itemSuffix: + outputOptions.override?.components?.schemas?.itemSuffix ?? 'Item', ...(outputOptions.override?.components?.schemas ?? {}), }, responses: {