Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 62C93200BEF for ; Wed, 30 Nov 2016 01:29:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6161B160B15; Wed, 30 Nov 2016 00:29:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AC92E160B23 for ; Wed, 30 Nov 2016 01:28:59 +0100 (CET) Received: (qmail 26028 invoked by uid 500); 30 Nov 2016 00:28:58 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 25773 invoked by uid 99); 30 Nov 2016 00:28:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2016 00:28:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6D9C82C03E5 for ; Wed, 30 Nov 2016 00:28:58 +0000 (UTC) Date: Wed, 30 Nov 2016 00:28:58 +0000 (UTC) From: "Suraj Acharya (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AVRO-1886) Improve error reporting for schema validation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 30 Nov 2016 00:29:00 -0000 [ https://issues.apache.org/jira/browse/AVRO-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15707037#comment-15707037 ] Suraj Acharya commented on AVRO-1886: ------------------------------------- {code} +1 overall | Vote | Subsystem | Runtime | Comment ============================================================================ | 0 | reexec | 1m 23s | Docker mode activated. | +1 | @author | 0m 0s | The patch does not contain any @author | | | | tags. | +1 | buildtest | 0m 0s | master passed | +1 | whitespace | 0m 1s | The patch has no whitespace issues. | +1 | buildtest | 0m 7s | the patch passed | | | 1m 43s | {code} > Improve error reporting for schema validation > --------------------------------------------- > > Key: AVRO-1886 > URL: https://issues.apache.org/jira/browse/AVRO-1886 > Project: Avro > Issue Type: Improvement > Components: ruby > Reporter: Miroslav Csonka > Assignee: Miroslav Csonka > Fix For: 1.9.0, 1.8.2 > > > In Funding Circle we use avro schema to validate some financial data and we've found ourselves wondering what is invalid. We've noticed that avro [does already validation|https://github.com/apache/avro/blob/master/lang/ruby/lib/avro/schema.rb#L94], but does not report what fields are invalid, so we've decided to change it and we use Avro as a validation library. > h5. What error messages to expect? > We communicate errors for a given payload in format "at ". > For we've decided to use syntax similar to json path: > * . refers to root > * \[0\] first index in array > * .age would match 42 from {"age": 42} > Error within object *person* and his optional array *houses* on *second item* with key *number_of_rooms*: > {quote} > at .person.houses\[1\].number_of_rooms expected type long, got string with value "not valid at all" > {quote} > Example of multiple errors for a single payload: > {quote} > at .\[0\] expected type int, got null > at .\[1\] expected type int, got string with value \"e\" > {quote} > More examples can be seen at https://github.com/apache/avro/pull/111/files#diff-830ac80276854fceefa3f92c346d165f -- This message was sent by Atlassian JIRA (v6.3.4#6332)