假设您有如下模式
(s/defschema House
{:bedroom s/Int
:bathroom s/Int
:parking s/Int
})swagger文档的动态生成将分配默认值0。如何为swagger文档指定卧室、浴室和停车场的默认值?
发布于 2020-12-18 11:57:34
我们可以使用ring.swagger.json-schema实现这一点。我们可以使用json-schema修改我们的模式
(s/defschema House
{:bedroom (ring.swagger.json-schema/field s/Int {:example 3})
:bathroom (ring.swagger.json-schema/field s/Int {:example 2})
:parking (ring.swagger.json-schema/field s/Int {:example 1})
})https://stackoverflow.com/questions/65351616
复制相似问题