Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128216 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 5FF921A00BC for ; Thu, 24 Jul 2025 14:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1753366046; bh=MnAKwShO4xYjbGXJ+T7TT7kFOxqIgbLy0TCb9SX2Jrk=; h=Date:From:To:In-Reply-To:References:Subject:From; b=j5gEOPqE8pbCao/uDzd2A2CutRTikTAP9IEnizbqohE85IWrDmOxkDJqO0KmSPl7J hH3eWRqccEQk7Mz4AmqoDTNKbktG8S6Y2Li3YHDxQc63HCvxlhRz4VexNhF3KF8pIU 8cEdNsJWYVBNV+3WKPNd3pnlY3g4SB8tKCfqnGWxbvKV7V66X2ToSkgBRQ6F+4WwGP EQ4cwJ9afRHAFpLkET8gezYhBMOFJby6ESmTKkPYiBbH14TzHEbz4h0O12OIY5O57z j4JfBOHGrMlsIH9Gc9QGO6in9DTdUswTBvcLv3JdlBtG/1UDWQ9ECqO1nGhYqNLk41 XVRlYwblc0fNA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 284E11801E1 for ; Thu, 24 Jul 2025 14:07:26 +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=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 fhigh-b1-smtp.messagingengine.com (fhigh-b1-smtp.messagingengine.com [202.12.124.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 24 Jul 2025 14:07:26 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 47F0D7A074E for ; Thu, 24 Jul 2025 10:09:10 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Thu, 24 Jul 2025 10:09:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm2; t=1753366150; x=1753452550; bh=e5om5waAxoQuT8XULgfgJ c/hqvX6dYvo43Y4RbOxbwY=; b=mBGOFpgdYBRMaQ+v4L7nFYaRtFweD7sTGwq6z lgF4ekji2u5U/sf+gYMFWP2F3ONiODJbEEAFHbSYQE9NaNKOXVzJKW86adVjVCPL 9D5zuHa8Q3pSxJh+KzFhCosKoKsOcAHnSQjz/sTvKCIxYS1aM4aEV+xcQ2f6Vh0J p5YhRomjuTebidcl2xnSPSlwXFmOKbOxYA8ab6sFP6cklnV7YrMP+PnhU2el1WBl Z62bn8HMIwiTaO9/j9O8FfWn9d2uB7ccpzgYskdWyfhTgh+HDUlA8cSEEXWC0BN7 MgTo3WNg2LJYcGQHNG5oyPAKB3ehHdUdrlupMwYuvEY9BcLKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1753366150; x=1753452550; bh=e 5om5waAxoQuT8XULgfgJc/hqvX6dYvo43Y4RbOxbwY=; b=KrztYQrb7Ba0lcTnM mieh/8VMPd7B7Al4BmRZiUboJIoANKjWV/Je1a1Ffd0t+cH+z2BkqAyfT94OiAnr a0WSFP45q6vA5trp0CcQHyzS7+GyJCw98R17qLyBImEqVOFk0mwMgJAXsP2eNwWk uisMNG7V7JodFAwiVOGliMBo3+LRAvacaCoErDfIuFfgZveeIXAqNphPZIYwNJhR GKTzbDaKyYmjIZGAoihM91tPGZTsVScobcJzvfWoIl90TQTJsWlrxvpvs3GW7eqn zfy4SOeZFXhYO2Zp9GhfyBEXrJ9PIK4cEeg4pRyFsb8JozrFX9e4deG8Y+JU+kXp +7NMw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdektdekhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvkfgjfhfutgfgsehtqhertdertdejnecuhfhrohhmpedfnfgrrhhrhicu ifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomheqne cuggftrfgrthhtvghrnhepffeiiedvhfdvgedutddtgeetieeugeevhfetheeffeeftedu iedthedtgeejueeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphht thhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhsse hlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D57A8700065; Thu, 24 Jul 2025 10:09:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T250b1b0d39f95e4a Date: Thu, 24 Jul 2025 09:08:49 -0500 To: "php internals" Message-ID: In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] JSON Schema validation support Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jul 24, 2025, at 1:51 AM, Alexandre Daubois wrote: > Hi Jakub, > > Le mer. 23 juil. 2025 =C3=A0 17:41, Jakub Zelenka a =C3= =A9crit : >> In addition it could be useful to create it from array or from class = (sort of auto generate schema) > > Writing schema by hand is painful, so that would be amazing to see > this feature land one day. I've done a little class <--> schema translation work in the past; this = is much harder than it sounds. :-) JSON Schema is considerably more com= plex/robust than PHP classes, so translating between the two is a challe= nge. (Maybe set hooks could cover some cases now? Hm.) Class->schema w= ould be easier, but in that case I think it would be better to either le= ave to user-space (it would just be a bit of reflection work) or if it's= in the core API to make it a separate operation from schema validation.= It's simple enough for a user to plug those two operations together th= emselves when appropriate. --Larry Garfield