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 CFE7E200D0C for ; Wed, 20 Sep 2017 15:18:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CE42D1609E4; Wed, 20 Sep 2017 13:18:15 +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 DE96A1609E1 for ; Wed, 20 Sep 2017 15:18:14 +0200 (CEST) Received: (qmail 95048 invoked by uid 500); 20 Sep 2017 13:18:13 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 94851 invoked by uid 99); 20 Sep 2017 13:18:13 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Sep 2017 13:18:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2BC801A3C05 for ; Wed, 20 Sep 2017 13:18:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id K5N7KChNryiY for ; Wed, 20 Sep 2017 13:18:12 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5873161116 for ; Wed, 20 Sep 2017 13:18:11 +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 8C541E0F24 for ; Wed, 20 Sep 2017 13:18:10 +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 41793218FA for ; Wed, 20 Sep 2017 13:18:09 +0000 (UTC) Date: Wed, 20 Sep 2017 13:18:09 +0000 (UTC) From: "Robert Munteanu (JIRA)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (SLING-4027) Improvement of the validation API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 20 Sep 2017 13:18:16 -0000 [ https://issues.apache.org/jira/browse/SLING-4027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Munteanu closed SLING-4027. ---------------------------------- > Improvement of the validation API > --------------------------------- > > Key: SLING-4027 > URL: https://issues.apache.org/jira/browse/SLING-4027 > Project: Sling > Issue Type: Improvement > Components: Validation > Reporter: Carsten Ziegeler > Assignee: Konrad Windszus > Fix For: Validation 1.0.0 > > > Some comments / thoughts about the validation api: > a) Why is there a validator lookup service? I don't think we need this in the API - it's a simple OSGI service lookup. > b) A Validator can only validate a single value - what if a property is an array and the validation needs to validate based on all supplied values? Same goes with dependencies between two properties? > c) The Validator interface returns null on success and a String (message) if validation fails. But it can also throw an exception if e.g. the provided value is null. I think a null value should be treated the same as a wrong value. Throwing the exception if some configuration like the regexp for the regexp validator is missing, is fine. but all errors of validating a value should be treated the same. > d) NonExistingTypeException I don't think we need this - IllegalArgumentException is fine to throw from the type enumeration > e) Maybe we can also remove the SlingValidationException - it is only thrown (see c) if a validator does not get its required configuration - which can be seen as an IllegalStateException > f) It would be nice to have a ValidationModelProvider interface - we will then have the current way of defining models as the default implememtation. But can allow other means of defining the validation model -- This message was sent by Atlassian JIRA (v6.4.14#64029)