diff --git a/packages/openapi-ts/src/openApi/3.0.x/parser/schema.ts b/packages/openapi-ts/src/openApi/3.0.x/parser/schema.ts index 63b9f3242..161943385 100644 --- a/packages/openapi-ts/src/openApi/3.0.x/parser/schema.ts +++ b/packages/openapi-ts/src/openApi/3.0.x/parser/schema.ts @@ -91,8 +91,8 @@ const getAllDiscriminatorValues = ({ context: Context; discriminator: NonNullable; schemaRef: string; -}): string[] => { - const values: string[] = []; +}): Array => { + const values: Array = []; // Check each entry in the discriminator mapping for (const [value, mappedSchemaRef] of Object.entries( @@ -405,7 +405,7 @@ const parseAllOf = ({ isRequired: boolean; values: ReadonlyArray; }; - const discriminatorsToAdd: DiscriminatorInfo[] = []; + const discriminatorsToAdd: Array = []; const addedDiscriminators = new Set(); for (const compositionSchema of compositionSchemas) { @@ -527,10 +527,7 @@ const parseAllOf = ({ // The inline schema should be the last non-$ref item in schemaItems let inlineSchema: IR.SchemaObject | undefined; for (let i = schemaItems.length - 1; i >= 0; i--) { - const item = schemaItems[i]; - if (!item) { - continue; - } + const item = schemaItems[i]!; // Check if this is not a $ref schema by looking for properties or checking if it came from an inline schema if (item.type === 'object' || item.properties) { inlineSchema = item; diff --git a/packages/openapi-ts/src/openApi/3.1.x/parser/schema.ts b/packages/openapi-ts/src/openApi/3.1.x/parser/schema.ts index 18c553fa9..abcf3b4dc 100644 --- a/packages/openapi-ts/src/openApi/3.1.x/parser/schema.ts +++ b/packages/openapi-ts/src/openApi/3.1.x/parser/schema.ts @@ -95,8 +95,8 @@ const getAllDiscriminatorValues = ({ context: Context; discriminator: NonNullable; schemaRef: string; -}): string[] => { - const values: string[] = []; +}): Array => { + const values: Array = []; // Check each entry in the discriminator mapping for (const [value, mappedSchemaRef] of Object.entries( @@ -487,7 +487,7 @@ const parseAllOf = ({ isRequired: boolean; values: ReadonlyArray; }; - const discriminatorsToAdd: DiscriminatorInfo[] = []; + const discriminatorsToAdd: Array = []; const addedDiscriminators = new Set(); for (const compositionSchema of compositionSchemas) { @@ -608,10 +608,7 @@ const parseAllOf = ({ // The inline schema should be the last non-$ref item in schemaItems let inlineSchema: IR.SchemaObject | undefined; for (let i = schemaItems.length - 1; i >= 0; i--) { - const item = schemaItems[i]; - if (!item) { - continue; - } + const item = schemaItems[i]!; // Check if this is not a $ref schema by looking for properties or checking if it came from an inline schema if (item.type === 'object' || item.properties) { inlineSchema = item;