FasterXML / FasterXML/jackson-annotations
Use 2 different `@JsonView` in a method (parameter and return)
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 342
- Avg merge
- 8h 53m
- Merged PRs (30d)
- 2
Description
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());
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.