Hi Alex, On Wed, Jul 23, 2025 at 3:57 PM Alexandre Daubois < alex.daubois+...@gmail.com> wrote:
> Thank you for proposing such a feature! I personally really like it > and would be glad to see this land into PHP. > I think it would be even more useful if JsonSchema offers more ways to > load a schema. Schemas are often either remotely stored or stored in a > file. > Yes, this is exactly the reason why it's using a static method and not a constructor It would be great to add two new factory methods: > JsonSchema::fromUri() and JsonSchema::fromFile(). Yeah something like this is planned in the next stage. In addition it could be useful to create it from array or from class (sort of auto generate schema) as well but that's all feature scope. > Maybe > JsonSchema::createFromString() should also be renamed to fromString() > to be consistent with the recent additions to XMLReader. > I actually took that name from recently introduced HTMLDocument::createFromString and XMLDocument::createFromString . So not sure what is more consistent. Personally I don't really mind. Kind regards Jakub