Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127895 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 7D0A01A00BC for ; Fri, 4 Jul 2025 23:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751670365; bh=qWrYRvvO8KCbQZuwKKBfx3vS/4VOitQAjRyxd1i57sQ=; h=From:Subject:Date:References:To:In-Reply-To:From; b=beYADCWmHGjZSUcDltimp4PCGPkr1FjPPI1zwztEswjkKPHGYoqGhlqGxO8MQ9VTW LExRCHlPYFbGGNHjBZiQSZFd4GS05dHQaVfTpsEqW0JkbyGtvbmD8rns/bXA7dMvHP wuAMkRZ/+bFJrE1J9KWO5V+xBd0hcqwnH5zU91vWvQdoS4TkrNcOx8LNROe9O21a7l QglmptrTLag5pDuI6JViaOb/lElQm44REY/qWlpDyNfCtqS/QjsO+bQ2SK7tmpHDRq avRB6fy/bCuml1NuwyFaS+rhSL3Z4vqV4oDjvuCnFVwrOPJHECmnM/oy3JoWXnPFL3 A7xCAyCm7ay3w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ABB1B18087A for ; Fri, 4 Jul 2025 23:06:04 +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.9 required=5.0 tests=BAYES_40,DMARC_NONE, HEADER_FROM_DIFFERENT_DOMAINS,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-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (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 23:06:04 +0000 (UTC) Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-e740a09eae0so1297326276.1 for ; Fri, 04 Jul 2025 16:07:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751670475; x=1752275275; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6+f9lzojgURwbVtlxJDbmWigdVBUbGLvSYB2bGSij+4=; b=eOkrhRan4MOdy154SNk4EzT+NcUkx0Dt7OmT6uaUf8bqDGKxkCXJXUFc9Xz55J6O0K fsi59WuPxi5mF3I3zGXz/VUImZzOyC3xzznbm11pnWhT8+9Dd6ekbZ94z2MrSysx9YnP oD+qz7O/exKNML+clOnHHbEZax1aLLwJG/IwrZS9ZTNCH80QDmH3secOmotCH3gplN+7 tiHkYc4/9Me2DI4Ud2ZocW2V2klv0+AetH3cfJ1ch12+AGlw20Tuhl4dOFkwArxo5ZLB NyTQtVFlg1LAYERIKcHHMCbGqROMTDljpVK662gRhwq5C+/cdiRmW1kmZ+2g4NV6rUH8 u2OA== X-Gm-Message-State: AOJu0YyZoa8pUBezpJjJ4615RPe82L6oJ2LLkw8wkDV8TKPZwLuQnC0z K/uZaJM9z1dZTNuTdZtmJYshdLXp4D3j0pvDEvW1RtnalW2F1N5p4y/a81LheyZzwYbQbPa40yO wwNfh7T6+ X-Gm-Gg: ASbGncs0rBYwtQn3Pt5+P7ogMwYgVADivMvk350OGsllf7hTYlzqNgMsdoHw5nzZUs6 Iv1p5Urvanc3fIJlBMtq+EW0TRgmO5XGfughz7tqgTASgPrrMOr6jDodBC50W14FNRCby/P3zic 6yNV9gA0CqMtQa4bBYqaKfpxtGmoEOlJX9i/GTBYJTj1N+5FRIYBjsBlPXJmACsJ5wvp1L/87RZ 9KaS6Z07BHjbLcZQN08QK7tOMNZJ21xB8Px0adDphMheC7JoxeL3fT909G+al95yxm0J1IxCn4A rQ0M+iDl7jqb8zUV6KotJjBCRHV1MOzZZTI8V4Jr9eHpC17yMsNgqBecEdx2hup0CpKnulYckcA dHLwlrJGwAfrhebPvAk6dS1rvxDLYPqM/V/mpr+xvsqT1z5x69A== X-Google-Smtp-Source: AGHT+IFpYKhix8pB4vSRiLU8SO/mIP85BPZWsbfAkNypcyjQJwqJKDDQmKH9NmEgpSQ4spNuSzMIwg== X-Received: by 2002:a05:6902:2583:b0:e84:1dd0:45a2 with SMTP id 3f1490d57ef6-e8b3cd6ccefmr520012276.40.1751670475247; Fri, 04 Jul 2025 16:07:55 -0700 (PDT) Received: from smtpclient.apple (h96-61-170-179.lvrgtn.broadband.dynamic.tds.net. [96.61.170.179]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e899c155d84sm930103276.0.2025.07.04.16.07.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jul 2025 16:07:54 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_F2D2A58E-016F-47AF-861C-7AC458ACFEE5"; protocol="application/pgp-signature"; micalg=pgp-sha256 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: [PHP-DEV] [RFC] JSON Schema validation support Date: Fri, 4 Jul 2025 18:07:43 -0500 References: To: PHP internals list In-Reply-To: Message-ID: <9B2997E3-21C9-47D9-BB54-99C83A481ED8@php.net> X-Mailer: Apple Mail (2.3826.600.51.1.1) From: ramsey@php.net (Ben Ramsey) --Apple-Mail=_F2D2A58E-016F-47AF-861C-7AC458ACFEE5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 4, 2025, at 16:01, Jakub Zelenka wrote: >=20 > Hello, >=20 > I would like introduce and open discussion for RFC proposing the = addition of JSON Schema validation support to JSON extension: >=20 > https://wiki.php.net/rfc/json_schema_validation >=20 > If this is successful, it should be just the first for further = improvements (see the future scope). >=20 > Kind regards, >=20 > Jakub There are 9 versions of JSON Schema and 11 Internet-Drafts, all of which = have expired. Many of these versions are still widely used in the wild = (draft-04, draft-05, and draft-06 come to mind as heavily used, despite = several newer versions). Which version do you plan to target with this RFC, or will it be able to = parse all versions, depending on what the input has specified in the = `$schema` properties? I=E2=80=99ve even seen multiple schema versions = used within the same set of referenced documents, and as long as the = parser knows how to handle all versions, it will parse things just fine. For the reference of others on the list, here=E2=80=99s what I mean by 9 = versions and 11 I-Ds: * Version: 2020-12 - https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-01 - https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00 * Version: 2019-09 - https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-02 * Version: draft-07 - https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01 - https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-00 * Version: draft-06 - https://datatracker.ietf.org/doc/html/draft-wright-json-schema-01 * Version: draft-05 - https://datatracker.ietf.org/doc/html/draft-wright-json-schema-00 * Version: draft-04 - https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-04 * Version: draft-03 - https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03 * Version: draft-02 - https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-02 * Version: draft-01 - https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-01 Typically, when you create a JSON Schema document, you specify the = `$schema` property, the value of which is a URI that refers to the = schema version you=E2=80=99re using, like this: ``` { "$schema": "https://json-schema.org/draft/2020-12/schema" } ``` This lets the parser know what =E2=80=9Cflavor=E2=80=9D of JSON Schema = you=E2=80=99re using. The problem is that many parsers don=E2=80=99t = understand all schema versions, and the most popular one in PHP = (justinrainbow/json-schema = ) only = supports draft-03 and draft-04, both well over 12 years old, at this = point. Perhaps the JSON Schema library that is most robust and supports the = latest versions is the opis/json-schema package = . It supports draft-06, draft-07, = 2019-09, and 2020-12, which is pretty much all the newer ones that = justinrainbow/json-schema doesn=E2=80=99t support. I think your RFC needs to address all these versions and how you plan to = address compatibility issues between them all. Since all the I-Ds have expired without a formal IETF RFC being voted on = and passing, you should probably call attention to the fact that JSON = Schema, while not moving much right now, is still a moving target and = any new versions will require updates to the core to support them. Cheers, Ben --Apple-Mail=_F2D2A58E-016F-47AF-861C-7AC458ACFEE5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iHUEAREIAB0WIQToXQMR3fpbrPOmEOewLZeYnIwHGwUCaGhevwAKCRCwLZeYnIwH G6UeAP0fVfC2egyJ+eiE40tbkNbd4HZedEdFHGDpWfXufJn1RgD+L3/k4pbUo94J biGziGK0B8VJ9I01JB/98HBTaZULUF8= =NotC -----END PGP SIGNATURE----- --Apple-Mail=_F2D2A58E-016F-47AF-861C-7AC458ACFEE5--