fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: improve types

Lubos 7e6945d8 47dd2a31

+3 -5
+3 -5
packages/shared/src/openApi/shared/transforms/readWrite.ts
··· 822 822 } 823 823 } else if (key === 'discriminator' && typeof value === 'object' && value !== null) { 824 824 // Update discriminator mappings to point to the correct read/write variants 825 - const discriminator = value as Record<string, unknown>; 826 - if (discriminator.mapping && typeof discriminator.mapping === 'object') { 827 - const mapping = discriminator.mapping as Record<string, string>; 825 + if ('mapping' in value && value.mapping && typeof value.mapping === 'object') { 828 826 const updatedMapping: Record<string, string> = {}; 829 - for (const [discriminatorValue, originalRef] of Object.entries(mapping)) { 827 + for (const [discriminatorValue, originalRef] of Object.entries(value.mapping)) { 830 828 const map = split.mapping[originalRef]; 831 829 if (map) { 832 830 if (nextContext === 'read' && map.read) { ··· 842 840 updatedMapping[discriminatorValue] = originalRef; 843 841 } 844 842 } 845 - discriminator.mapping = updatedMapping; 843 + value.mapping = updatedMapping; 846 844 } 847 845 // Continue walking the discriminator object for other properties 848 846 walk({