cod*_*ent 5 spring spring-mvc swagger swagger-2.0
我想记录对象的“获取”和“创建”操作Resource (Integer id, String name)。当我在 Spring MVC 应用程序中使用 Springfox 配置 Swagger 时,文档显示:
GET /resources -> Model: { "id" : 0 , "name" : "string"}
POST /resources -> Request body: { "id" : 0 , "name" : "string"}
-> Response 201: { "id" : 0 , "name" : "string"}
Run Code Online (Sandbox Code Playgroud)
关键是“id”参数不应该在 POST 正文中,因为它将在操作中创建。我的问题是,有没有办法表明某些财产仅在某些情况下应从文档中排除?
| 归档时间: |
|
| 查看次数: |
1739 次 |
| 最近记录: |