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 2B8BE200C1B for ; Tue, 14 Feb 2017 13:00:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2A329160B6A; Tue, 14 Feb 2017 12:00:06 +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 4C7C0160B52 for ; Tue, 14 Feb 2017 13:00:05 +0100 (CET) Received: (qmail 94284 invoked by uid 500); 14 Feb 2017 12:00:04 -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 94273 invoked by uid 99); 14 Feb 2017 12:00:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2017 12:00:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id EF495C02CA for ; Tue, 14 Feb 2017 12:00:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.198 X-Spam-Level: X-Spam-Status: No, score=-1.198 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id V9oqip3LMpXw for ; Tue, 14 Feb 2017 12:00:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4331B5F47E for ; Tue, 14 Feb 2017 12:00:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A4813E078B for ; Tue, 14 Feb 2017 11:59:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 03FEE24129 for ; Tue, 14 Feb 2017 11:59:42 +0000 (UTC) Date: Tue, 14 Feb 2017 11:59:42 +0000 (UTC) From: "David Lantos (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (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: Tue, 14 Feb 2017 12:00:06 -0000 [ https://issues.apache.org/jira/browse/AVRO-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15865660#comment-15865660 ] David Lantos edited comment on AVRO-1886 at 2/14/17 11:58 AM: -------------------------------------------------------------- It does seem to be 2.1 related: On 2.3.3 I get 0 failures: {code} 83 tests, 945 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed {code} On 2.4.0 I get three failures: {code} 83 tests, 939 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 96.3855% passed expected 'at . expected type boolean, got int with value 1' to be in '["at . expected type boolean, got long with value 1"]'. expected 'at .fruits expected type array, got int with value 1' to be in '["at .fruits expected type array, got long with value 1"]'. expected 'at . expected type null, got int with value 1' to be in '["at . expected type null, got long with value 1"]'. {code} They all seem to be related to {{1}} being {{long}}, not {{int}} as the spec expects -- but that is expected due to [Fixnum-Integer changes in 2.4|https://blog.heroku.com/ruby-2-4-features-hashes-integers-rounding#fixnum-by-ruby]. was (Author: sldblog): It does seem to be 2.1 related: On 2.3.3 I get 0 failures: {code} Finished in 0.526283 seconds. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 83 tests, 945 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 157.71 tests/s, 1795.61 assertions/s {code} On 2.4.0 I get three failures: {code} ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 83 tests, 939 assertions, 3 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 96.3855% passed ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 164.37 tests/s, 1859.58 assertions/s expected 'at . expected type boolean, got int with value 1' to be in '["at . expected type boolean, got long with value 1"]'. expected 'at .fruits expected type array, got int with value 1' to be in '["at .fruits expected type array, got long with value 1"]'. expected 'at . expected type null, got int with value 1' to be in '["at . expected type null, got long with value 1"]'. {code} They all seem to be related to {{1}} being {{long}}, not {{int}} as the spec expects -- but that is expected due to [Fixnum-Integer changes in 2.4|https://blog.heroku.com/ruby-2-4-features-hashes-integers-rounding#fixnum-by-ruby]. > 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.15#6346)