nullable fields in swagger on node.js

前端 未结 4 684
[愿得一人]
[愿得一人] 2021-01-04 02:42

I\'ve spent a bunch of time trying to find a solution for creating swagger docs in Node.JS. The main library is swagger-node, in which you create a swagger yaml file and the

4条回答
  •  轮回少年
    2021-01-04 02:47

    SwaggerUI doesn't support nullable types (please, see here). But I used nullable properties as:

    type: ['string','null']
    

    After that this property disappears from UI, but validation still worked.

提交回复
热议问题