Skip to content

Commit dbe2c79

Browse files
maxholmanclaude
andcommitted
fix: emit unknown output type when response has no JSON content
Operations with non-JSON responses (e.g. streaming, plain text) were missing the Output type argument on Command, shifting Query into the Output slot and Header into the Query slot. This caused type errors in generated commands for specs like Docker Engine API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4c42185 commit dbe2c79

22 files changed

Lines changed: 98 additions & 34 deletions

__tests__/fixtures/docker/commands.ts

Lines changed: 62 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2026-05-02T05:45:49.139Z
6+
* Generated on 2026-05-02T06:45:34.878Z
77
*
88
*/
99
/** eslint-disable max-classes */
@@ -521,6 +521,7 @@ export class ContainerTopCommand extends Command<
521521
*/
522522
export class ContainerLogsCommand extends Command<
523523
ContainerLogsCommandInput,
524+
unknown,
524525
ContainerLogsCommandQuery
525526
> {
526527
public override method = "get" as const;
@@ -574,7 +575,10 @@ export class ContainerChangesCommand extends Command<
574575
*
575576
* @summary Export a container
576577
*/
577-
export class ContainerExportCommand extends Command<ContainerExportCommandInput> {
578+
export class ContainerExportCommand extends Command<
579+
ContainerExportCommandInput,
580+
unknown
581+
> {
578582
public override method = "get" as const;
579583
static paramsSchema = containerExportCommandParamsSchema;
580584

@@ -643,6 +647,7 @@ export class ContainerStatsCommand extends Command<
643647
*/
644648
export class ContainerResizeCommand extends Command<
645649
ContainerResizeCommandInput,
650+
unknown,
646651
ContainerResizeCommandQuery
647652
> {
648653
public override method = "post" as const;
@@ -945,6 +950,7 @@ export class ContainerUnpauseCommand extends Command<
945950
*/
946951
export class ContainerAttachCommand extends Command<
947952
ContainerAttachCommandInput,
953+
unknown,
948954
ContainerAttachCommandQuery
949955
> {
950956
public override method = "post" as const;
@@ -968,6 +974,7 @@ export class ContainerAttachCommand extends Command<
968974
*/
969975
export class ContainerAttachWebsocketCommand extends Command<
970976
ContainerAttachWebsocketCommandInput,
977+
unknown,
971978
ContainerAttachWebsocketCommandQuery
972979
> {
973980
public override method = "get" as const;
@@ -1039,6 +1046,7 @@ export class ContainerDeleteCommand extends Command<
10391046
*/
10401047
export class ContainerArchiveCommand extends Command<
10411048
ContainerArchiveCommandInput,
1049+
unknown,
10421050
ContainerArchiveCommandQuery
10431051
> {
10441052
public override method = "get" as const;
@@ -1066,6 +1074,7 @@ export class ContainerArchiveCommand extends Command<
10661074
*/
10671075
export class PutContainerArchiveCommand extends Command<
10681076
PutContainerArchiveCommandInput,
1077+
unknown,
10691078
PutContainerArchiveCommandQuery
10701079
> {
10711080
public override method = "put" as const;
@@ -1091,6 +1100,7 @@ export class PutContainerArchiveCommand extends Command<
10911100
*/
10921101
export class ContainerArchiveInfoCommand extends Command<
10931102
ContainerArchiveInfoCommandInput,
1103+
unknown,
10941104
ContainerArchiveInfoCommandQuery
10951105
> {
10961106
public override method = "head" as const;
@@ -1171,6 +1181,7 @@ export class ImageListCommand extends Command<
11711181
*/
11721182
export class ImageBuildCommand extends Command<
11731183
ImageBuildCommandInput,
1184+
unknown,
11741185
ImageBuildCommandQuery,
11751186
ImageBuildCommandHeader
11761187
> {
@@ -1274,6 +1285,7 @@ export class BuildPruneCommand extends Command<
12741285
*/
12751286
export class ImageCreateCommand extends Command<
12761287
ImageCreateCommandInput,
1288+
unknown,
12771289
ImageCreateCommandQuery,
12781290
ImageCreateCommandHeader
12791291
> {
@@ -1352,6 +1364,7 @@ export class ImageHistoryCommand extends Command<
13521364
*/
13531365
export class ImagePushCommand extends Command<
13541366
ImagePushCommandInput,
1367+
unknown,
13551368
ImagePushCommandQuery,
13561369
ImagePushCommandHeader
13571370
> {
@@ -1377,6 +1390,7 @@ export class ImagePushCommand extends Command<
13771390
*/
13781391
export class ImageTagCommand extends Command<
13791392
ImageTagCommandInput,
1393+
unknown,
13801394
ImageTagCommandQuery
13811395
> {
13821396
public override method = "post" as const;
@@ -1521,7 +1535,10 @@ export class SystemVersionCommand extends Command<
15211535
*
15221536
* @summary Ping
15231537
*/
1524-
export class SystemPingCommand extends Command<SystemPingCommandInput> {
1538+
export class SystemPingCommand extends Command<
1539+
SystemPingCommandInput,
1540+
unknown
1541+
> {
15251542
public override method = "get" as const;
15261543

15271544
constructor() {
@@ -1534,7 +1551,10 @@ export class SystemPingCommand extends Command<SystemPingCommandInput> {
15341551
*
15351552
* @summary Ping
15361553
*/
1537-
export class SystemPingHeadCommand extends Command<SystemPingHeadCommandInput> {
1554+
export class SystemPingHeadCommand extends Command<
1555+
SystemPingHeadCommandInput,
1556+
unknown
1557+
> {
15381558
public override method = "head" as const;
15391559

15401560
constructor() {
@@ -1673,7 +1693,7 @@ export class SystemDataUsageCommand extends Command<
16731693
*
16741694
* @summary Export an image
16751695
*/
1676-
export class ImageGetCommand extends Command<ImageGetCommandInput> {
1696+
export class ImageGetCommand extends Command<ImageGetCommandInput, unknown> {
16771697
public override method = "get" as const;
16781698
static paramsSchema = imageGetCommandParamsSchema;
16791699

@@ -1700,6 +1720,7 @@ export class ImageGetCommand extends Command<ImageGetCommandInput> {
17001720
*/
17011721
export class ImageGetAllCommand extends Command<
17021722
ImageGetAllCommandInput,
1723+
unknown,
17031724
ImageGetAllCommandQuery
17041725
> {
17051726
public override method = "get" as const;
@@ -1721,6 +1742,7 @@ export class ImageGetAllCommand extends Command<
17211742
*/
17221743
export class ImageLoadCommand extends Command<
17231744
ImageLoadCommandInput,
1745+
unknown,
17241746
ImageLoadCommandQuery
17251747
> {
17261748
public override method = "post" as const;
@@ -1758,7 +1780,7 @@ export class ContainerExecCommand extends Command<
17581780
*
17591781
* @summary Start an exec instance
17601782
*/
1761-
export class ExecStartCommand extends Command<ExecStartCommandInput> {
1783+
export class ExecStartCommand extends Command<ExecStartCommandInput, unknown> {
17621784
public override method = "post" as const;
17631785
static bodySchema = execStartCommandBodySchema;
17641786
static paramsSchema = execStartCommandParamsSchema;
@@ -1777,6 +1799,7 @@ export class ExecStartCommand extends Command<ExecStartCommandInput> {
17771799
*/
17781800
export class ExecResizeCommand extends Command<
17791801
ExecResizeCommandInput,
1802+
unknown,
17801803
ExecResizeCommandQuery
17811804
> {
17821805
public override method = "post" as const;
@@ -1869,6 +1892,7 @@ export class VolumeInspectCommand extends Command<
18691892
*/
18701893
export class VolumeUpdateCommand extends Command<
18711894
VolumeUpdateCommandInput,
1895+
unknown,
18721896
VolumeUpdateCommandQuery
18731897
> {
18741898
public override method = "put" as const;
@@ -2014,7 +2038,10 @@ export class NetworkCreateCommand extends Command<
20142038
*
20152039
* @summary Connect a container to a network
20162040
*/
2017-
export class NetworkConnectCommand extends Command<NetworkConnectCommandInput> {
2041+
export class NetworkConnectCommand extends Command<
2042+
NetworkConnectCommandInput,
2043+
unknown
2044+
> {
20182045
public override method = "post" as const;
20192046
static bodySchema = networkConnectCommandBodySchema;
20202047
static paramsSchema = networkConnectCommandParamsSchema;
@@ -2030,7 +2057,10 @@ export class NetworkConnectCommand extends Command<NetworkConnectCommandInput> {
20302057
*
20312058
* @summary Disconnect a container from a network
20322059
*/
2033-
export class NetworkDisconnectCommand extends Command<NetworkDisconnectCommandInput> {
2060+
export class NetworkDisconnectCommand extends Command<
2061+
NetworkDisconnectCommandInput,
2062+
unknown
2063+
> {
20342064
public override method = "post" as const;
20352065
static bodySchema = networkDisconnectCommandBodySchema;
20362066
static paramsSchema = networkDisconnectCommandParamsSchema;
@@ -2174,6 +2204,7 @@ export class PluginDeleteCommand extends Command<
21742204
*/
21752205
export class PluginEnableCommand extends Command<
21762206
PluginEnableCommandInput,
2207+
unknown,
21772208
PluginEnableCommandQuery
21782209
> {
21792210
public override method = "post" as const;
@@ -2197,6 +2228,7 @@ export class PluginEnableCommand extends Command<
21972228
*/
21982229
export class PluginDisableCommand extends Command<
21992230
PluginDisableCommandInput,
2231+
unknown,
22002232
PluginDisableCommandQuery
22012233
> {
22022234
public override method = "post" as const;
@@ -2267,7 +2299,10 @@ export class PluginCreateCommand extends Command<
22672299
*
22682300
* @summary Push a plugin
22692301
*/
2270-
export class PluginPushCommand extends Command<PluginPushCommandInput> {
2302+
export class PluginPushCommand extends Command<
2303+
PluginPushCommandInput,
2304+
unknown
2305+
> {
22712306
public override method = "post" as const;
22722307
static paramsSchema = pluginPushCommandParamsSchema;
22732308

@@ -2340,6 +2375,7 @@ export class NodeInspectCommand extends Command<
23402375
*/
23412376
export class NodeDeleteCommand extends Command<
23422377
NodeDeleteCommandInput,
2378+
unknown,
23432379
NodeDeleteCommandQuery
23442380
> {
23452381
public override method = "delete" as const;
@@ -2359,6 +2395,7 @@ export class NodeDeleteCommand extends Command<
23592395
*/
23602396
export class NodeUpdateCommand extends Command<
23612397
NodeUpdateCommandInput,
2398+
unknown,
23622399
NodeUpdateCommandQuery
23632400
> {
23642401
public override method = "post" as const;
@@ -2415,7 +2452,7 @@ export class SwarmInitCommand extends Command<
24152452
*
24162453
* @summary Join an existing swarm
24172454
*/
2418-
export class SwarmJoinCommand extends Command<SwarmJoinCommandInput> {
2455+
export class SwarmJoinCommand extends Command<SwarmJoinCommandInput, unknown> {
24192456
public override method = "post" as const;
24202457
static bodySchema = swarmJoinCommandBodySchema;
24212458

@@ -2432,6 +2469,7 @@ export class SwarmJoinCommand extends Command<SwarmJoinCommandInput> {
24322469
*/
24332470
export class SwarmLeaveCommand extends Command<
24342471
SwarmLeaveCommandInput,
2472+
unknown,
24352473
SwarmLeaveCommandQuery
24362474
> {
24372475
public override method = "post" as const;
@@ -2450,6 +2488,7 @@ export class SwarmLeaveCommand extends Command<
24502488
*/
24512489
export class SwarmUpdateCommand extends Command<
24522490
SwarmUpdateCommandInput,
2491+
unknown,
24532492
SwarmUpdateCommandQuery
24542493
> {
24552494
public override method = "post" as const;
@@ -2498,7 +2537,10 @@ export class SwarmUnlockkeyCommand extends Command<
24982537
*
24992538
* @summary Unlock a locked manager
25002539
*/
2501-
export class SwarmUnlockCommand extends Command<SwarmUnlockCommandInput> {
2540+
export class SwarmUnlockCommand extends Command<
2541+
SwarmUnlockCommandInput,
2542+
unknown
2543+
> {
25022544
public override method = "post" as const;
25032545
static bodySchema = swarmUnlockCommandBodySchema;
25042546

@@ -2579,7 +2621,10 @@ export class ServiceInspectCommand extends Command<
25792621
*
25802622
* @summary Delete a service
25812623
*/
2582-
export class ServiceDeleteCommand extends Command<ServiceDeleteCommandInput> {
2624+
export class ServiceDeleteCommand extends Command<
2625+
ServiceDeleteCommandInput,
2626+
unknown
2627+
> {
25832628
public override method = "delete" as const;
25842629
static paramsSchema = serviceDeleteCommandParamsSchema;
25852630

@@ -2630,6 +2675,7 @@ export class ServiceUpdateCommand extends Command<
26302675
*/
26312676
export class ServiceLogsCommand extends Command<
26322677
ServiceLogsCommandInput,
2678+
unknown,
26332679
ServiceLogsCommandQuery
26342680
> {
26352681
public override method = "get" as const;
@@ -2703,6 +2749,7 @@ export class TaskInspectCommand extends Command<
27032749
*/
27042750
export class TaskLogsCommand extends Command<
27052751
TaskLogsCommandInput,
2752+
unknown,
27062753
TaskLogsCommandQuery
27072754
> {
27082755
public override method = "get" as const;
@@ -2808,6 +2855,7 @@ export class SecretDeleteCommand extends Command<
28082855
*/
28092856
export class SecretUpdateCommand extends Command<
28102857
SecretUpdateCommandInput,
2858+
unknown,
28112859
SecretUpdateCommandQuery
28122860
> {
28132861
public override method = "post" as const;
@@ -2905,6 +2953,7 @@ export class ConfigDeleteCommand extends Command<
29052953
*/
29062954
export class ConfigUpdateCommand extends Command<
29072955
ConfigUpdateCommandInput,
2956+
unknown,
29082957
ConfigUpdateCommandQuery
29092958
> {
29102959
public override method = "post" as const;
@@ -2968,7 +3017,7 @@ export class DistributionInspectCommand extends Command<
29683017
*
29693018
* @summary Initialize interactive session
29703019
*/
2971-
export class SessionCommand extends Command<SessionCommandInput> {
3020+
export class SessionCommand extends Command<SessionCommandInput, unknown> {
29723021
public override method = "post" as const;
29733022

29743023
constructor() {

__tests__/fixtures/docker/hono-valibot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PublicValibotHonoError } from "@block65/rest-client";
44
*
55
* WARN: Do not edit directly.
66
*
7-
* Generated on 2026-05-02T05:45:49.139Z
7+
* Generated on 2026-05-02T06:45:34.878Z
88
*
99
*/
1010
import { validator } from "hono/validator";

__tests__/fixtures/docker/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2026-05-02T05:45:49.139Z
6+
* Generated on 2026-05-02T06:45:34.878Z
77
*
88
*/
99
import {

__tests__/fixtures/docker/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2026-05-02T05:45:49.139Z
6+
* Generated on 2026-05-02T06:45:34.878Z
77
*
88
*/
99
import type { Jsonifiable } from "type-fest";

__tests__/fixtures/docker/valibot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2026-05-02T05:45:49.139Z
6+
* Generated on 2026-05-02T06:45:34.878Z
77
*
88
*/
99
import * as v from "valibot";

__tests__/fixtures/openai/commands.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2026-05-02T05:45:12.436Z
6+
* Generated on 2026-05-02T06:44:56.439Z
77
*
88
*/
99
/** eslint-disable max-classes */
@@ -490,7 +490,10 @@ export class CreateEmbeddingCommand extends Command<
490490
*
491491
* @summary Generates audio from the input text.
492492
*/
493-
export class CreateSpeechCommand extends Command<CreateSpeechCommandInput> {
493+
export class CreateSpeechCommand extends Command<
494+
CreateSpeechCommandInput,
495+
unknown
496+
> {
494497
public override method = "post" as const;
495498
static bodySchema = createSpeechCommandBodySchema;
496499

0 commit comments

Comments
 (0)