zenstruck / browser

A fluent interface for your Symfony functional tests.
MIT License
186 stars 17 forks source link

`Json::matchesSchema()` #93

Closed kbond closed 2 years ago

kbond commented 2 years ago

Per conversation with @nikophil. Use justinrainbow/json-schema to validate schema.

I don't have any experience with json schema but is it common the include the schema files in some kind of resource directory in your project? If so, maybe a BROWSER_JSON_SCHEMA_DIR env variable could be used to set this dir, then with: $json->matchesSchema('post.json'), post.json would be loaded relative to this env variable?

nikophil commented 2 years ago

I've not ever worked on a project where we did something like that

kbond commented 2 years ago

Ok, probably just start with the same api as api-platform uses (pass array or json string).

kbond commented 2 years ago

Closed via #102