@@ -0,0 +1,2105 @@
+package org.gluu.oxtrust.service.scim2.serialization;%0A%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.codehaus.jackson.JsonGenerator;%0Aimport org.codehaus.jackson.JsonNode;%0Aimport org.codehaus.jackson.map.JsonSerializer;%0Aimport org.codehaus.jackson.map.ObjectMapper;%0Aimport org.codehaus.jackson.map.SerializerProvider;%0Aimport org.gluu.oxtrust.model.scim2.BaseScimResource;%0Aimport org.gluu.oxtrust.model.scim2.ListResponse;%0Aimport org.apache.logging.log4j.Logger;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.gluu.oxtrust.model.scim2.Constants.LIST_RESPONSE_SCHEMA_ID;%0A%0A/**%0A * Created by jgomer on 2017-10-01.%0A */%0Apublic class ListResponseJsonSerializer extends JsonSerializer%3CListResponse%3E %7B%0A%0A    private Logger log = LogManager.getLogger(getClass());%0A    private ScimResourceSerializer resourceSerializer;%0A    private ObjectMapper mapper = new ObjectMapper();%0A%0A    public ListResponseJsonSerializer(ScimResourceSerializer serializer)%7B%0A        resourceSerializer=serializer;%0A    %7D%0A%0A    @Override%0A    public void serialize(ListResponse listResponse, JsonGenerator jGen, SerializerProvider provider) throws IOException %7B%0A%0A        jGen.writeStartObject();%0A        jGen.writeNumberField(%22totalResults%22, listResponse.getTotalResults());%0A        jGen.writeNumberField(%22startIndex%22, listResponse.getStartIndex());%0A        jGen.writeNumberField(%22itemsPerPage%22, listResponse.getItemsPerPage());%0A%0A        jGen.writeArrayFieldStart(%22schemas%22);%0A        jGen.writeString(LIST_RESPONSE_SCHEMA_ID);%0A        jGen.writeEndArray();%0A%0A        jGen.writeArrayFieldStart(%22Resources%22);%0A        for (BaseScimResource resource : listResponse.getResources())%7B%0A            try %7B%0A                log.debug(%22oh margoth%22);%0A                JsonNode jsonResource=mapper.readTree(resourceSerializer.serialize(resource));%0A                jGen.writeTree(jsonResource);%0A                //jGen.writeString(resourceSerializer.serialize(resource));%0A            %7D%0A            catch (Exception e)%7B%0A                throw new IOException(e);%0A            %7D%0A        %7D%0A        jGen.writeEndArray();%0A%0A        jGen.writeEndObject();%0A%0A    %7D%0A%0A%7D%0A

Add custom serializer for ListResponse class