@@ -24,7 +24,7 @@ function applyOneOfTransformations(api) {
2424 transformationPaths = oneOfTransformations . map ( ( e ) => e . path ) ;
2525 console . info (
2626 "# OneOf transformations: " +
27- JSON . stringify ( transformationPaths , undefined , 2 )
27+ JSON . stringify ( transformationPaths , undefined , 2 ) ,
2828 ) ;
2929
3030 for ( let { path } of oneOfTransformations ) {
@@ -44,11 +44,11 @@ function transformOneOf(objectPath, api) {
4444
4545 // Expand references
4646 const childObjects = parentObject . oneOf . map ( ( childRef ) =>
47- getObjectFromReference ( childRef , api )
47+ getObjectFromReference ( childRef , api ) ,
4848 ) ;
4949 const isEnum = childObjects . reduce (
5050 ( isEnum , childObject ) => isEnum && childObject . enum ,
51- true
51+ true ,
5252 ) ;
5353
5454 if ( isEnum ) {
@@ -61,7 +61,7 @@ function transformOneOf(objectPath, api) {
6161// Moves all the enum values of the children into the parent
6262function transformOneOfEnum ( parentObject , api ) {
6363 const childObjects = parentObject . oneOf . map ( ( childRef ) =>
64- getObjectFromReference ( childRef , api )
64+ getObjectFromReference ( childRef , api ) ,
6565 ) ;
6666
6767 if ( ! parentObject . enum ) {
@@ -86,7 +86,7 @@ function transformOneOfEnum(parentObject, api) {
8686// Moves all the propertis of the children into the parent
8787function transformOneOfProperties ( parentObject , api ) {
8888 const childObjects = parentObject . oneOf . map ( ( childRef ) =>
89- getObjectFromReference ( childRef , api )
89+ getObjectFromReference ( childRef , api ) ,
9090 ) ;
9191
9292 for ( let childObject of childObjects ) {
@@ -106,10 +106,10 @@ function transformOneOfProperties(parentObject, api) {
106106 } else {
107107 // Otherwise this situation require human intervention
108108 console . error (
109- "OpenAPI object is missing properties or allOf field. This is usually an error in the OpenAPI spec."
109+ "OpenAPI object is missing properties or allOf field. This is usually an error in the OpenAPI spec." ,
110110 ) ;
111111 console . error (
112- "Please ensure that elements of oneOf schema are objects (classes) instead of single types (bool, string etc.)."
112+ "Please ensure that elements of oneOf schema are objects (classes) instead of single types (bool, string etc.)." ,
113113 ) ;
114114 throw new Error ( `${ JSON . stringify ( childObject , "" , 2 ) } ` ) ;
115115 }
@@ -144,8 +144,8 @@ function handleDuplicates(parentObject, childObject) {
144144 `${ duplicatesSource } mismatch type detected: ${ JSON . stringify (
145145 mismatches ,
146146 undefined ,
147- 2
148- ) } `
147+ 2 ,
148+ ) } `,
149149 ) ;
150150 }
151151 }
@@ -160,7 +160,7 @@ function filterReferenceOrTypeMissmatch(mismatches) {
160160 if ( mismatch . key === ignoredProperty ) {
161161 console . warn (
162162 "Type mismatch found when merging base types. Ignoring due to known mismatches" ,
163- JSON . stringify ( mismatch , undefined , 2 )
163+ JSON . stringify ( mismatch , undefined , 2 ) ,
164164 ) ;
165165 return false ;
166166 }
@@ -175,12 +175,12 @@ function mergeDuplicates(
175175 duplicatesSourceLabel ,
176176 duplicates ,
177177 childObject ,
178- parentObject
178+ parentObject ,
179179) {
180180 console . info (
181181 `## ${ duplicatesSourceLabel } - Detected properties that would be overriden: ${ JSON . stringify (
182- duplicates
183- ) } \n`
182+ duplicates ,
183+ ) } \n`,
184184 ) ;
185185 for ( duplicate of duplicates ) {
186186 childProperty = childObject . properties [ duplicate . key ] ;
0 commit comments