FasterXML / FasterXML/jackson-annotations

Use 2 different `@JsonView` in a method (parameter and return)

未关闭
#265 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
1.1k
派生
342
平均合并
8 小时 53 分钟
30 天内合并 PR
2

描述

Allow using one view as input and a different view of the same DTO as output to a method.
Like this :

```
@POST
@Path("/add")
@JsonView(parameter=ExempleViews.Ajout.class, return=ExempleViews.Response.class) // <-- like this
@APIResponse(responseCode = "201", description = "Add with success")
@APIResponse(responseCode = "400", description = "Bad request")
@APIResponse(responseCode = "409", description = "Conflict in database")
@APIResponse(responseCode = "500", description = "Internal error")
public Uni add(@Valid @NotNull ExampleDto exampleDto) {

return exampleService
.add(exampleDto)
.map(e -> Response.ok(e).status(Status.CREATED).build());
}
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。