packages/openapi-ts/README.md
Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
- Updated discriminator test snapshots (3.0.x and 3.1.x) for:
- discriminator-all-of
- discriminator-allof-nested
- transformers-all-of
- Regenerated openapi-ts-fetch example with updated types
- All snapshots now reflect the Omit<> wrapper for discriminator properties
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
- Remove union of child discriminator values from intermediate types
- Each type now gets only its direct discriminator value
- Use Omit<> to remove parent discriminator properties and avoid conflicts
- Enables proper TypeScript type narrowing with discriminated unions
Example: CarDto.$type is now 'Car' instead of 'Car' | 'Volvo'
VolvoDto uses Omit<CarDto, '$type'> & { $type: 'Volvo' }
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
feat: Propagate OpenAPI extension fields (x-*) to IR and plugins
- Changed parseExtensions to use Record<string, unknown> instead of any
- Added type assertions at call sites for type safety
- Restored SpecificationExtensions to CallbackObject, PathsObject, ResponsesObject
- Kept PathsObject with [path: /${string}] template literal type
- Extended index signatures with | unknown to satisfy TypeScript
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Fix discriminator resolution in nested allOf inheritance hierarchies
- Changed parseExtensions to use any types instead of generic constraints
- Removed SpecificationExtensions from interfaces with index signatures (CallbackObject, PathsObject, ResponsesObject)
- Changed PathsObject index signature from /${string} to string for compatibility
- These changes fix TypeScript errors while preserving extension field support
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
- 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>
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>