Skip to content

"const" keyword not working #56

Description

@SchMatthieu

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" }'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions