Skip to content

Commit dc28099

Browse files
Copilotmrlubos
andcommitted
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 parent 0e24571 commit dc28099

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/openapi-ts/src/plugins/@hey-api/transformers

packages/openapi-ts/src/plugins/@hey-api/transformers/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export const handler: HeyApiTransformersPlugin['Handler'] = ({ plugin }) => {
267267
const { response } = operationResponsesMap(operation);
268268
if (!response) return;
269269

270-
if (response.items && response.items.length > 1) {
270+
if (response.items && response.items.length > 1 && response.logicalOperator !== 'and') {
271271
if (plugin.context.config.logs.level === 'debug') {
272272
console.warn(
273273
`❗️ 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`,

0 commit comments

Comments
 (0)