6
6
} from './';
7
7
8
8
{ {/hasImports} }
9
+
9
10
/**
10
11
* @type { {classname} }
11
12
* Type
@@ -19,14 +20,14 @@ export type {{classname}} = {{#oneOf}}{{{.}}}{{^-last}} | {{/-last}}{{/oneOf}};
19
20
* @export
20
21
*/
21
22
export class { {classname} }Class {
23
+
22
24
{{#discriminator} }
23
25
24
26
static readonly discriminator: string | undefined = "{ {discriminatorName} }";
25
- // static readonly discriminator: string = "type";
26
-
27
27
{ {/discriminator} }
28
28
{ {^discriminator} }
29
- static readonly discriminator: string | undefined = undefined;
29
+ { {! Note: discriminator is not defined in OpenAPI spec, fallback to `type` } }
30
+ static readonly discriminator: string = "type";
30
31
{ {/discriminator} }
31
32
{ {#hasDiscriminatorWithNonEmptyMapping} }
32
33
@@ -35,19 +36,18 @@ export class {{classname}}Class {
35
36
"{ {mappingName} }": "{ {modelName} }",
36
37
{ {/discriminator.mappedModels} }
37
38
};
39
+ { {! Note: discriminator is not defined in OpenAPI spec, it should generate something like this:
40
+ static readonly mapping: { [key: string]: string } = {
41
+ " await" : " CheckoutAwaitAction" ,
42
+ " bankTransfer" : " CheckoutBankTransferAction" ,
43
+ " redirect" : " CheckoutRedirectAction" ,
44
+ " threeDS2" : " CheckoutThreeDS2Action" ,
45
+ " sdk" : " CheckoutSDKAction" ,
46
+ " voucher" : " CheckoutVoucherAction" ,
47
+ } ; }}
38
48
{ {/hasDiscriminatorWithNonEmptyMapping} }
39
49
{ {^hasDiscriminatorWithNonEmptyMapping} }
40
50
41
51
static readonly mapping: { [index: string]: string} | undefined = undefined;
42
52
{ {/hasDiscriminatorWithNonEmptyMapping} }
43
-
44
- // static readonly mapping: { [key: string]: string } = {
45
- // " await" : " CheckoutAwaitAction" ,
46
- // " bankTransfer" : " CheckoutBankTransferAction" ,
47
- // " redirect" : " CheckoutRedirectAction" ,
48
- // " threeDS2" : " CheckoutThreeDS2Action" ,
49
- // " sdk" : " CheckoutSDKAction" ,
50
- // " voucher" : " CheckoutVoucherAction" ,
51
- // Add all other action types...
52
- } ;
53
53
}
0 commit comments