Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127883 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id C79621A00BC for ; Fri, 4 Jul 2025 21:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751665682; bh=XPgoub3WEof9bInIbL3oD7wZKzNIx1r2yPeAjUr8rTo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fli9ms7in4as4EP+69ISEUbpwjLYm/d+W//eabaxbUQWMR/35T8cV0ODkg3th8gRi 9d79bX7PFO1U1/653F/Vqff4hOw5hk6dHaLZUa+i8bexRcDb37oHQf6TNN6+r2Vq1A SwDU8BAuwA/azuPrM7zrAXIq6W1dHkv4qhcHJm7f20NB6JrvspvdvxeER4qnxeWdbI KOOgbrIargD5fd1NpdPaC5pnOKlCfrX+UwEqeyBYyazAidr9BcTt7sXrpPEV+jxoGU 7erV4EA9vDti1FUBf9b8AekKWlTOpVxugc8fNUAoMnD5hVjUH9qXkQlLVZ0mANxTeA +aGRM4wOjKtLw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EE41718006C for ; Fri, 4 Jul 2025 21:48:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 4 Jul 2025 21:47:58 +0000 (UTC) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-451dbe494d6so14278255e9.1 for ; Fri, 04 Jul 2025 14:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751665789; x=1752270589; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XPgoub3WEof9bInIbL3oD7wZKzNIx1r2yPeAjUr8rTo=; b=SoUvrMdEi75ey3/OZUdjf3sDe8VfyvN3aPorPMkEvlG11+gGGErl1ZzNBiJ9O2S0Ti 30x8BRuLnYPX3cHe4ReAMu1PleUYWWIdDuvLYWKrimTV98bBWjoa1fx30xOpFLXHw0pz NAJbauuDGybW+NfBz/ybl5f+b8PlkX3t86imG/z/RA4Io5NX5N7Rf+Q0Zi1zWJheSFxi FpUtxZyKRkzFdsofs4v1ev3lKongew1/I/L8U3nGGV8ePsMYn0orybF/CMiypEPZEqpC pqsoYX0EQSRzCShve+mDE0lyI93befOOfxPgzGDFITTWRZzb4QiHUNACol4q9gRergX0 e+SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751665789; x=1752270589; 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=XPgoub3WEof9bInIbL3oD7wZKzNIx1r2yPeAjUr8rTo=; b=fZ+e7OEURd2PDCC1z1i1xlNhfGC7Y9GYVkmrF22ZgWQiiW9fNldN8Y8pO6pF5myY18 bThbA/f2VtLHrzdMajtlak3owyjYsgzYOvAJFFIciBNxbrmDWMz2x2EfMKmFjz7EDRCF c/1m9yoLWPNvMpEosC2XEcqve5B/eZRBj31s7UEnPQsupiw5fTMDxcMDxhPO2/5Ku9bA D1AJgGOC2swsVG45XzOuvIr06AexKNr1PcYC5qOtIa4zqiHiPiRD49OLNTf+IDffeKmT NPR2JA4tbACX8hq2cEeMsbS1eE7J3HW8sJYff7d/tksr12Ct4UFB+UXv6WTpnB8eiFkN Trzw== X-Gm-Message-State: AOJu0YzPqzNI1nr98etajY2zAD0zDDSaMYMV8Xp/N+zQe/oIVywHGGww U3Z4MMMvu3MfFcpvbdZgDF0herbwMV2zCfQyw/xnS6X1RzLMR112h7iesOHwer2EQzNQtVlfmPO r+DwnB3l8anfaYJ2edTOMtBve0xaBhVi4VpI7McJd X-Gm-Gg: ASbGnctjeu72tnyR2Jan/eZTgVDA9258NGyQPJ2fnmnPLGR1xGQ/aeOwgiizCjjNcHh mq2koRKdgi6xU228gaSkx+n2lUXSal4Kq3EZwen8ozz6KsRKMdqu7EwrfW80O7btx1NMA/k5/YF nPN10vmaFHi/75fI08tCEftUFbVlC3HfvPxlaIuB9jHg== X-Google-Smtp-Source: AGHT+IGXEXgFWoWSBT0anWtjBW4XkZfRasFp+pp/aK7YL5l3eEKLIMQMYZVXssfIaC4krT+kCX+WLtjx5BKaxTWo5/E= X-Received: by 2002:a05:600c:8b64:b0:43c:fdbe:4398 with SMTP id 5b1f17b1804b1-454b4e6e641mr29718715e9.6.1751665789092; Fri, 04 Jul 2025 14:49:49 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 5 Jul 2025 00:49:38 +0300 X-Gm-Features: Ac12FXw0J_Sr2xsjOuDnRVgixXU398cE88HMSIaxD9C3qlcsCKITMoQW8Gu0cE0 Message-ID: Subject: Re: [PHP-DEV] [RFC] JSON Schema validation support To: Jakub Zelenka Cc: PHP internals list Content-Type: multipart/alternative; boundary="0000000000001fc7d3063921790b" From: udaltsov.valentin@gmail.com (Valentin Udaltsov) --0000000000001fc7d3063921790b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sta, 5 July 2025=E2=80=AFat 00:04, Jakub Zelenka wrote: > Hello, > > I would like introduce and open discussion for RFC proposing the addition > of JSON Schema validation support to JSON extension: > > https://wiki.php.net/rfc/json_schema_validation > > If this is successful, it should be just the first for further > improvements (see the future scope). > > Kind regards, > > Jakub > Hi, Jakub! I like the idea. I have a couple of initial thoughts: 1. Wouldn't it make sense to place all the new classes under the `Json` namespace, similar to how it=E2=80=99s done in `ext-random`? 2. If there=E2=80=99s no way to interact with the `JsonSchema` class, what = purpose does it serve? Wouldn=E2=80=99t it be simpler to just extend `json_decode()= ` with an optional `?string $schema =3D null` parameter? --=20 Kind regards, Valentin --0000000000001fc7d3063921790b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sta, 5 July 2025=E2=80=AFat 00:04, Jakub Zelenka &= lt;bukka@php.net> wrote:
Hello,

I would like = introduce and open discussion for RFC proposing the addition of JSON Schema= validation support to JSON extension:


If thi= s is successful, it should be just the first for further improvements (see = the future scope).

Kind regards,

Jakub

Hi, Jakub!

I like the idea. I have a cou= ple of initial thoughts:

1. Wouldn't it make sense to place all = the new classes under the `Json` namespace, similar to how it=E2=80=99s don= e in `ext-random`?
2. If there=E2=80=99s no way to interact with = the `JsonSchema` class, what purpose does it serve? Wouldn=E2=80=99t it be = simpler to just extend `json_decode()` with an optional `?string $schema = =3D null` parameter?

--
Kind regards,
Valentin
--0000000000001fc7d3063921790b--