@@ -392,7 +392,7 @@ describe('Definition generation', () => {
392392 } ,
393393 strLiteralArr : ( propertyName , propertySchema ) => {
394394 expect ( propertySchema . type ) . to . eq ( 'array' , `for property ${ propertyName } .type` ) ;
395- expect ( propertySchema ! . items ! . $ref ) . to . eq ( '#/definitions/StrLiteral' , `for property ${ propertyName } .$ref` ) ;
395+ expect ( propertySchema . items ! . $ref ) . to . eq ( '#/definitions/StrLiteral' , `for property ${ propertyName } .$ref` ) ;
396396 expect ( propertySchema ) . to . not . haveOwnProperty ( 'additionalProperties' , `for property ${ propertyName } ` ) ;
397397
398398 expect ( propertySchema [ 'x-nullable' ] ) . to . eq ( undefined , `for property ${ propertyName } [x-nullable]` ) ;
@@ -722,7 +722,8 @@ describe('Definition generation', () => {
722722 excludeToEnum : { $ref : '#/definitions/Exclude_EnumUnion.EnumNumberValue_' , description : undefined , format : undefined , example : undefined } ,
723723 excludeToAlias : { $ref : '#/definitions/Exclude_ThreeOrFour.TypeAliasModel3_' , description : undefined , format : undefined , example : undefined } ,
724724 excludeLiteral : {
725- $ref : '#/definitions/Exclude_keyofTestClassModel.account-or-defaultValue2-or-indexedTypeToInterface-or-indexedTypeToClass-or-indexedTypeToAlias-or-indexedResponseObject_' ,
725+ $ref :
726+ '#/definitions/Exclude_keyofTestClassModel.account-or-defaultValue2-or-indexedTypeToInterface-or-indexedTypeToClass-or-indexedTypeToAlias-or-indexedResponseObject-or-arrayUnion-or-objectUnion_' ,
726727 description : undefined ,
727728 format : undefined ,
728729 example : undefined ,
@@ -850,7 +851,7 @@ describe('Definition generation', () => {
850851 ) ;
851852
852853 const excludeLiteral = getValidatedDefinition (
853- 'Exclude_keyofTestClassModel.account-or-defaultValue2-or-indexedTypeToInterface-or-indexedTypeToClass-or-indexedTypeToAlias-or-indexedResponseObject_ ' ,
854+ 'Exclude_keyofTestClassModel.account-or-defaultValue2-or-indexedTypeToInterface-or-indexedTypeToClass-or-indexedTypeToAlias-or-indexedResponseObject-or-arrayUnion-or-objectUnion_ ' ,
854855 currentSpec ,
855856 ) ;
856857 expect ( excludeLiteral ) . to . deep . eq (
@@ -970,6 +971,24 @@ describe('Definition generation', () => {
970971 indexedTypeToClass : { $ref : '#/definitions/IndexedClass' , description : undefined , format : undefined , example : undefined } ,
971972 indexedTypeToInterface : { $ref : '#/definitions/IndexedInterface' , description : undefined , format : undefined , example : undefined } ,
972973 keyInterface : { type : 'string' , default : undefined , description : undefined , format : undefined , example : undefined , 'x-nullable' : false , enum : [ 'id' ] } ,
974+ arrayUnion : {
975+ default : undefined ,
976+ description : undefined ,
977+ enum : [ 'foo' , 'bar' ] ,
978+ example : undefined ,
979+ format : undefined ,
980+ type : 'string' ,
981+ 'x-nullable' : false ,
982+ } ,
983+ objectUnion : {
984+ default : undefined ,
985+ description : undefined ,
986+ enum : [ 'foo' , 'bar' ] ,
987+ example : undefined ,
988+ format : undefined ,
989+ type : 'string' ,
990+ 'x-nullable' : false ,
991+ } ,
973992 optionalPublicConstructorVar : { type : 'string' , default : undefined , description : undefined , format : undefined , example : undefined } ,
974993 readonlyConstructorArgument : { type : 'string' , default : undefined , description : undefined , format : undefined , example : undefined } ,
975994 publicConstructorVar : { type : 'string' , default : undefined , description : 'This is a description for publicConstructorVar' , format : undefined , example : undefined } ,
0 commit comments