java - How to set all non nullable properties of swagger responses as required?
问题描述
I have a Spring Boot web app that exposes an openApi interface using swagger UI. Currently when I'm looking at responses schemas in the generated api docs json I see that fields that are not nullable are not marked as "required" by the framework. I'm looking for a way to globally set at least all primitive values as required, if possible also other types (like UUID for example). I'm trying to avoid the need for annotating each individual property as @NotNull or something of this sort since there are too many classes and properties and its just not going to happen.
Thanks.
解决方案
推荐阅读
- html -
- c++ - 为什么我不能通过 std::vector
到这个带有模板模板参数的函数? - javascript - 当我点击它们时,如何为不同的图像按钮播放不同的音频?
- python - Python梯形法作图
- java - dlopen 失败:找不到符号“_ZN7android10VectorImpl19reservedVectorImpl1Ev”
- r - 基于 2 列表的 xy 绘图
- web-scraping - 在异步 Webscraping 中循环访问 IP 地址
- python - 用python计算电影文件中的音轨
- python - 如何将滑块中的值分配给变量?我只能使用 .get() 打印输出,而不是存储它
- javascript - 有人可以解释为什么 h.style 返回未定义,而 h[0].style 已定义?