@Override
    public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException {
        Schema schemaAnnotation = null;
        for (Annotation annotation : annotations) {
            if (annotation.annotationType().equals(Schema.class)) {
                schemaAnnotation = (Schema) annotation;
                break;
            }
        }

        if (schemaAnnotation != null) {
            ObjectMapper mapper = locateMapper(type, mediaType);
            JsonParser jp = mapper.getFactory().createJsonParser(entityStream);
            jp.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE);
            URL schemaLocation = schemaLookup.getSchemaURL(schemaAnnotation.value());
            JsonSchema jsonSchema = cache.getSchema(schemaLocation);
            JsonNode jsonNode = mapper.readTree(jp);
            List<ErrorMessage> validationErrors = jsonSchema.validate(jsonNode);
            if (validationErrors.isEmpty()) {
                return mapper.reader().withType(mapper.constructType(genericType)).readValue(jsonNode);
            }

            throw new WebApplicationException(generateErrorMessage(validationErrors));
        } else {
            return super.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream);
        }
    }