mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Produce custom media type
This commit is contained in:
@@ -43,7 +43,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.ext.ContextResolver;
|
||||
import javax.ws.rs.ext.Provider;
|
||||
|
||||
@@ -54,7 +53,7 @@ import javax.ws.rs.ext.Provider;
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Provider
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Produces("application/*+json")
|
||||
public final class JSONContextResolver implements ContextResolver<ObjectMapper> {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Singleton
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Produces("application/vnd.scmm-user+json")
|
||||
public class UserCollectionResource extends AbstractManagerResource<User, UserException> {
|
||||
private final UserDto2UserMapper dtoToUserMapper;
|
||||
private final User2UserDtoMapper userToDtoMapper;
|
||||
|
||||
@@ -17,7 +17,7 @@ import javax.ws.rs.core.*;
|
||||
import java.util.Collection;
|
||||
|
||||
@Singleton
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Produces("application/vnd.scmm-user+json")
|
||||
public class UserSubResource extends AbstractManagerResource<User, UserException> {
|
||||
private final UserDto2UserMapper dtoToUserMapper;
|
||||
private final User2UserDtoMapper userToDtoMapper;
|
||||
|
||||
Reference in New Issue
Block a user