@@ -64,9 +64,9 @@ export class SchemaObjectFactory {
6464      if  ( ! isBodyParameter ( param ) )  { 
6565        return  this . createQueryOrParamSchema ( param ,  schemas ) ; 
6666      } 
67- 
6867      return  this . getCustomType ( param ,  schemas ) ; 
6968    } ) ; 
69+ 
7070    return  flatten ( parameterObjects ) ; 
7171  } 
7272
@@ -257,6 +257,10 @@ export class SchemaObjectFactory {
257257          'selfRequired' 
258258        ] ; 
259259
260+         if  ( '$ref'  in  property )  { 
261+           return  omit ( pick ( property ,  '$ref' ) ,  keysToOmit ) ; 
262+         } 
263+ 
260264        if  ( 'required'  in  property  &&  Array . isArray ( property . required ) )  { 
261265          return  omit ( property ,  keysToOmit ) ; 
262266        } 
@@ -279,6 +283,7 @@ export class SchemaObjectFactory {
279283      typeDefinition [ 'required' ]  =  typeDefinitionRequiredFields ; 
280284    } 
281285    schemas [ schemaName ]  =  typeDefinition ; 
286+ 
282287    return  schemaName ; 
283288  } 
284289
@@ -406,7 +411,9 @@ export class SchemaObjectFactory {
406411        enum :
407412          metadata . isArray  &&  metadata . items 
408413            ? metadata . items [ 'enum' ] 
409-             : metadata . enum 
414+             : metadata . enum , 
415+         description : metadata . description  ??  undefined , 
416+         'x-enumNames' : metadata [ 'x-enumNames' ]  ??  undefined 
410417      } ; 
411418    }  else  { 
412419      if  ( metadata . enumSchema )  { 
@@ -415,6 +422,10 @@ export class SchemaObjectFactory {
415422          ...metadata . enumSchema 
416423        } ; 
417424      } 
425+ 
426+       if  ( metadata [ 'x-enumNames' ] )  { 
427+         schemas [ enumName ] [ 'x-enumNames' ]  =  metadata [ 'x-enumNames' ] ; 
428+       } 
418429    } 
419430
420431    const  _schemaObject  =  { 
@@ -426,6 +437,7 @@ export class SchemaObjectFactory {
426437    const  refHost  =  metadata . isArray 
427438      ? {  items : {  $ref }  } 
428439      : {  allOf : [ {  $ref } ]  } ; 
440+ 
429441    const  paramObject  =  {  ..._schemaObject ,  ...refHost  } ; 
430442    const  pathsToOmit  =  [ 'enum' ,  'enumName' ,  'enumSchema' ] ; 
431443
0 commit comments