How to add Jackson annotations to specific fields on swagger generated model classes for Spring

耗尽温柔 提交于 2021-02-10 23:58:11

问题


Folks,

With swagger 2.0 does anyone know if it's possible to add Jackson annotations to specific fields on swagger generated model classes when using swagger codegen with 'spring' as the 'language' <language>spring</language>?

I want to use Jackson JSON Views & would like to add the view annotations to provide different views of the generated models when I return them from the various REST endpoints. However, I could not find any documentation if any on this on swagger.

I see this slightly similar question both having the same problem, which is either the lack of support or the lack of documentation for this basic functionality.

I am frankly quite surprised how swagger can be used beyond basic hello world examples with this type of real-world support issue...

Thanks

来源:https://stackoverflow.com/questions/64779606/how-to-add-jackson-annotations-to-specific-fields-on-swagger-generated-model-cla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!