Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119657 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25377 invoked from network); 2 Mar 2023 19:31:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Mar 2023 19:31:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7AFF21804AC for ; Thu, 2 Mar 2023 11:31:58 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 2 Mar 2023 11:31:58 -0800 (PST) Received: by mail-ed1-f46.google.com with SMTP id o12so1305490edb.9 for ; Thu, 02 Mar 2023 11:31:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ERLBqr308Yukxp7xuTQKy0Hs2DYtyi2aCEFXxAtMWyE=; b=Y0RDuIecVWNbiFFrpmgGJx9vY8+BeVmr6ELBWb/5SGKXPSGI3CYs3FGTaJMzFXBDTG fc7mDQuSrTTKSpuhPaYJFmYXIbsJRoDKZH1oIo4xLqwfsOYf4r6QLZAw5PXhjkDxtufm yrDPhfpnTJMr8TWoWxG4YbBAZ8sbpN2wcnGQ81gep4E+TAsjQuSks44q7Uxwl4a9KG9T TUswM+ZvtWVpVBAdX60XOGvHAwqk2s8ah8XwYAw0obDQfGlajOTVhT6rKnoW2HkjxgBI H8WzvrhIs4EH5LCRwavnqEAZUPtv91zQ9HkhAKICFJpazG4CoqTh8DwWES9K47yewKyV QEOQ== X-Gm-Message-State: AO0yUKVqHSVi69uJzCen4TIAaSdYLXp1WaxtOM6efRvuqLjPoqhfyHwi nO3ULQPqcWmEch990JAovnVS1sDNnUDXPcbGOPQ= X-Google-Smtp-Source: AK7set/6WInaMV1hnoVP7fE7n5nbRZKFfmebeTCIYoxg4sqcf/Jx6XwM5oou4wZ2jW+QdclOBZtbH5AgO4dgEcuCflk= X-Received: by 2002:a50:998e:0:b0:4ad:6052:ee90 with SMTP id m14-20020a50998e000000b004ad6052ee90mr6573765edb.7.1677785516621; Thu, 02 Mar 2023 11:31:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 2 Mar 2023 19:31:45 +0000 Message-ID: To: Rowan Tommins Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000ba43b605f5efe11b" Subject: Re: [PHP-DEV] RFC Idea - json_validate() validate schema From: bukka@php.net (Jakub Zelenka) --000000000000ba43b605f5efe11b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 2, 2023 at 5:53=E2=80=AFPM Rowan Tommins wrote: > On Thu, 2 Mar 2023 at 12:34, Jakub Zelenka wrote: > > > It's possible that we might decide to stop supporting some drafts if th= e > > maintenance burden is too big and usage small but I wouldn't see that a= s > > something that happens often. But essentially you are right that there > will > > be minimum (draft-04 initially) and maximum (latest implemented draft). > > > > > Thinking about this, particularly if there is the ability to install a PE= CL > extension which supports different versions from the core PHP version, > perhaps it would be useful to expose a function or constant that lists th= e > supported versions, so that code needing a particular version could check > for support directly, rather than having to attempt and catch an exceptio= n? > > That's a good point. I think a constant should be sufficient. I think the different classes make less sense if $schema is specified as I would think that the $schema should have a priority. So having just default argument using the constant for the cases where it's not specified should be sufficient IMHO. Cheers Jakub --000000000000ba43b605f5efe11b--