File tree Expand file tree Collapse file tree 5 files changed +102
-1
lines changed 
modules/openapi-generator/src/test/resources/3_0/typescript-fetch 
samples/client/petstore/typescript-fetch/builds/oneOf Expand file tree Collapse file tree 5 files changed +102
-1
lines changed Original file line number Diff line number Diff line change @@ -93,4 +93,9 @@ components:
9393            - " optionTwo" 
9494          type : string 
9595      required :
96-         - discriminatorField 
96+         - discriminatorField 
97+     VariousOneOf :
98+       oneOf :
99+         - type : string 
100+         - type : integer 
101+         - type : boolean 
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ docs/TestArrayResponse.md
88docs/TestB.md
99docs/TestDiscriminatorResponse.md
1010docs/TestResponse.md
11+ docs/VariousOneOf.md
1112index.ts
1213models/OptionOne.ts
1314models/OptionTwo.ts
@@ -16,5 +17,6 @@ models/TestArrayResponse.ts
1617models/TestB.ts
1718models/TestDiscriminatorResponse.ts
1819models/TestResponse.ts
20+ models/VariousOneOf.ts
1921models/index.ts
2022runtime.ts
Original file line number Diff line number Diff line change 1+ 
2+ # VariousOneOf  
3+ 
4+ 
5+ ## Properties  
6+ 
7+ Name | Type
8+ ------------ | -------------
9+ 
10+ ## Example  
11+ 
12+ ``` typescript 
13+ import  type  { VariousOneOf  } from  ' ' 
14+ 
15+ //  TODO: Update the object below with actual values
16+ const =  {
17+ } satisfies  VariousOneOf 
18+ 
19+ console .log (example )
20+ 
21+ //  Convert the instance to a JSON string
22+ const :  string  =  JSON .stringify (example )
23+ console .log (exampleJSON )
24+ 
25+ //  Parse the JSON string back to an object
26+ const =  JSON .parse (exampleJSON ) as  VariousOneOf 
27+ console .log (exampleParsed )
28+ ``` 
29+ 
30+ [[ Back to top]] ( # )  [[ Back to API list]] ( ../README.md#api-endpoints )  [[ Back to Model list]] ( ../README.md#models )  [[ Back to README]] ( ../README.md ) 
31+ 
32+ 
Original file line number Diff line number Diff line change 1+ /* tslint:disable */ 
2+ /* eslint-disable */ 
3+ /** 
4+  * testing oneOf without discriminator 
5+  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 
6+  * 
7+  * The version of the OpenAPI document: 1.0.0 
8+  *  
9+  * 
10+  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 
11+  * https://openapi-generator.tech 
12+  * Do not edit the class manually. 
13+  */ 
14+ 
15+ /** 
16+  * @type  VariousOneOf 
17+  *  
18+  * @export  
19+  */ 
20+ export  type  VariousOneOf  =  boolean  |  number  |  string ; 
21+ 
22+ export  function  VariousOneOfFromJSON ( json : any ) : VariousOneOf  { 
23+     return  VariousOneOfFromJSONTyped ( json ,  false ) ; 
24+ } 
25+ 
26+ export  function  VariousOneOfFromJSONTyped ( json : any ,  ignoreDiscriminator : boolean ) : VariousOneOf  { 
27+     if  ( json  ==  null )  { 
28+         return  json ; 
29+     } 
30+     if  ( typeof  json  ===  'boolean' )  { 
31+         return  json ; 
32+     } 
33+     if  ( typeof  json  ===  'number' )  { 
34+         return  json ; 
35+     } 
36+     if  ( typeof  json  ===  'string' )  { 
37+         return  json ; 
38+     } 
39+     return  { }  as  any ; 
40+ } 
41+ 
42+ export  function  VariousOneOfToJSON ( json : any ) : any  { 
43+     return  VariousOneOfToJSONTyped ( json ,  false ) ; 
44+ } 
45+ 
46+ export  function  VariousOneOfToJSONTyped ( value ?: VariousOneOf  |  null ,  ignoreDiscriminator : boolean  =  false ) : any  { 
47+     if  ( value  ==  null )  { 
48+         return  value ; 
49+     } 
50+     if  ( typeof  value  ===  'boolean' )  { 
51+         return  value ; 
52+     } 
53+     if  ( typeof  value  ===  'number' )  { 
54+         return  value ; 
55+     } 
56+     if  ( typeof  value  ===  'string' )  { 
57+         return  value ; 
58+     } 
59+     return  { } ; 
60+ } 
61+ 
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ export * from './TestArrayResponse';
77export  *  from  './TestB' ; 
88export  *  from  './TestDiscriminatorResponse' ; 
99export  *  from  './TestResponse' ; 
10+ export  *  from  './VariousOneOf' ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments