File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -653,9 +653,26 @@ describe('convertV2WithTypes', function() {
653
653
654
654
expect ( parsedRequestBody ) . to . have . property ( 'anyOf' ) ;
655
655
expect ( parsedRequestBody . anyOf ) . to . be . an ( 'array' ) . with . length ( 3 ) ;
656
- // Note: $ref schemas are resolved to empty objects, but composite structure is preserved
657
- expect ( parsedRequestBody . anyOf [ 2 ] ) . to . have . property ( 'type' , 'object' ) ;
658
- expect ( parsedRequestBody . anyOf [ 2 ] . properties ) . to . have . property ( 'guest' ) ;
656
+ expect ( parsedRequestBody . anyOf [ 0 ] ) . to . deep . equal ( {
657
+ type : 'object' ,
658
+ properties : {
659
+ id : { type : 'integer' } ,
660
+ name : { type : 'string' }
661
+ }
662
+ } ) ;
663
+ expect ( parsedRequestBody . anyOf [ 1 ] ) . to . deep . equal ( {
664
+ type : 'object' ,
665
+ properties : {
666
+ role : { type : 'string' } ,
667
+ permissions : { type : 'array' , items : { type : 'string' } }
668
+ }
669
+ } ) ;
670
+ expect ( parsedRequestBody . anyOf [ 2 ] ) . to . deep . equal ( {
671
+ type : 'object' ,
672
+ properties : {
673
+ guest : { type : 'boolean' }
674
+ }
675
+ } ) ;
659
676
660
677
// Check response body has allOf structure
661
678
const responseBody = conversionResult . extractedTypes [ 'post/test' ] . response [ '200' ] . body ;
You can’t perform that action at this time.
0 commit comments