packages/openapi-ts/README.md
Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gzFix discriminator resolution in nested allOf inheritance hierarchies
- Replaced unnecessary null checks with non-null assertions (!) in for loops accessing array items
- Changed all [] type syntax to Array<T> or ReadonlyArray<T> format for consistency
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
- Changed DiscriminatorInfo.values type from string[] to ReadonlyArray<string> to match discriminatorValues return type
- Added null check for array item access to prevent possibly undefined errors
- Changed required array mutation from push to spread operator to work with readonly arrays
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Removed getAllDiscriminatorValues and union logic. Now each schema gets only its own discriminator value from the mapping, matching the requested output format.
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Changed logic to include all child discriminator values in a union for intermediate schemas (e.g., CarDto now has $type: 'Car' | 'Volvo' instead of no discriminator). Removed unused helper function.
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Fix: Support moduleResolution "node16" alongside "nodenext"
Added test scenarios for discriminator-allof-nested.json in both 3.0.x and 3.1.x test suites with generated snapshots validating the fix
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Prevent adding discriminator values to schemas that are extended by other schemas in the same discriminator mapping, fixing the never type issue in nested allOf hierarchies
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Add helper function to recursively find discriminators in allOf schemas and update parseAllOf to use it for both OpenAPI 3.0.x and 3.1.x
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>