Description
We use the test folder in the repository to test our jsonSchema. We have created a class based on the same structure as AssertTaitTest.php
.
But when we want to test our json the keyword const
doesn't work despite the errors put in the schema on purpose. However, the keyword enum
works and is well taken into account in the errors.
You can find attached our test json and the associated schema.
Thanks in advance!
Our jsonSchema:
{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://<ourwebsite.fr/Schemas/ApiComponent/OuvragePush", "title": "Api Component Schema: Ouvrage Push", "type": "object", "properties": { "type": { "type": "string", "const": "OuvragePush"}, "price": { "type": "string", "const": "United States of America" } }, "required": [ "type", "price" ] }
Our mock json data:
'{ "type":"OuvragePushooo", "price": "14" }'