browser icon indicating copy to clipboard operation
browser copied to clipboard

`Json::matchesSchema()`

Open kbond opened this issue 2 years ago • 2 comments

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?

kbond avatar Jun 29 '22 18:06 kbond

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

nikophil avatar Jun 30 '22 15:06 nikophil

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

kbond avatar Jun 30 '22 15:06 kbond

Closed via #102

kbond avatar Sep 01 '22 03:09 kbond