Skip to content

Commit ffbe547

Browse files
committed
Updated examples for improved discriminator allOf support
1 parent 0d8c81c commit ffbe547

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

packages/openapi-typescript/examples/digital-ocean-api.ts

+28-12
Original file line numberDiff line numberDiff line change
@@ -9881,18 +9881,26 @@ export interface components {
98819881
*/
98829882
type: "assign" | "unassign";
98839883
};
9884-
floating_ip_action_assign: {
9885-
type: "assign";
9886-
} & (Omit<components["schemas"]["floatingIPsAction"], "type"> & {
9884+
floating_ip_action_assign: Omit<components["schemas"]["floatingIPsAction"], "type"> & {
98879885
/**
98889886
* @description The ID of the Droplet that the floating IP will be assigned to.
98899887
* @example 758604968
98909888
*/
98919889
droplet_id: number;
9892-
});
9893-
floating_ip_action_unassign: {
9890+
} & {
9891+
/**
9892+
* @description discriminator enum property added by openapi-typescript
9893+
* @enum {string}
9894+
*/
9895+
type: "assign";
9896+
};
9897+
floating_ip_action_unassign: Omit<components["schemas"]["floatingIPsAction"], "type"> & Record<string, never> & {
9898+
/**
9899+
* @description discriminator enum property added by openapi-typescript
9900+
* @enum {string}
9901+
*/
98949902
type: "unassign";
9895-
} & (Omit<components["schemas"]["floatingIPsAction"], "type"> & Record<string, never>);
9903+
};
98969904
namespace_info: {
98979905
/**
98989906
* @description The namespace's API hostname. Each function in a namespace is provided an endpoint at the namespace's hostname.
@@ -11555,18 +11563,26 @@ export interface components {
1155511563
*/
1155611564
type: "assign" | "unassign";
1155711565
};
11558-
reserved_ip_action_assign: {
11559-
type: "assign";
11560-
} & (Omit<components["schemas"]["reserved_ip_action_type"], "type"> & {
11566+
reserved_ip_action_assign: Omit<components["schemas"]["reserved_ip_action_type"], "type"> & {
1156111567
/**
1156211568
* @description The ID of the Droplet that the reserved IP will be assigned to.
1156311569
* @example 758604968
1156411570
*/
1156511571
droplet_id: number;
11566-
});
11567-
reserved_ip_action_unassign: {
11572+
} & {
11573+
/**
11574+
* @description discriminator enum property added by openapi-typescript
11575+
* @enum {string}
11576+
*/
11577+
type: "assign";
11578+
};
11579+
reserved_ip_action_unassign: Omit<components["schemas"]["reserved_ip_action_type"], "type"> & Record<string, never> & {
11580+
/**
11581+
* @description discriminator enum property added by openapi-typescript
11582+
* @enum {string}
11583+
*/
1156811584
type: "unassign";
11569-
} & (Omit<components["schemas"]["reserved_ip_action_type"], "type"> & Record<string, never>);
11585+
};
1157011586
snapshots: {
1157111587
/**
1157211588
* @description The unique identifier for the snapshot.

0 commit comments

Comments
 (0)