Rest接口报错 Content type ‘application/json;charset=UTF-8‘ not supported

 

今天测试组提上来的bug中在测试接口时报错:Content type 'application/json;charset=UTF-8' not supported

 

但是其他问题都没这种情况就这个接口有问题:Rest接口报错 Content type ‘application/json;charset=UTF-8‘ not supported

发现在dto定义了相同报文字段时,swagger生成的报文中不会出现重复字段,连字段都没有

根据网上找的解决办法,最后发现整个接口都没啥问题,就是定义字段时重复,竟然swagger没有报错啥的,直接在生成的报文中不显示这个字段了

Rest接口报错 Content type ‘application/json;charset=UTF-8‘ not supported