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.

Fix: Generate transformers for allOf response schemas

The transformer plugin was incorrectly skipping response schemas with allOf compositions. The check for multiple response items was conflating:
1. Multiple 2XX status codes (union with logicalOperator: 'or')
2. AllOf compositions (intersection with logicalOperator: 'and')

Fix: Only skip transformer generation when there are multiple response status codes (logicalOperator !== 'and'), not when there's an allOf/intersection composition.

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+1 -1
+1 -1
packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts
··· 267 267 const { response } = operationResponsesMap(operation); 268 268 if (!response) return; 269 269 270 - if (response.items && response.items.length > 1) { 270 + if (response.items && response.items.length > 1 && response.logicalOperator !== 'and') { 271 271 if (plugin.context.config.logs.level === 'debug') { 272 272 console.warn( 273 273 `❗️ Transformers warning: route ${createOperationKey(operation)} has ${response.items.length} non-void success responses. This is currently not handled and we will not generate a response transformer. Please open an issue if you'd like this feature https://github.com/hey-api/openapi-ts/issues`,