Skip to content

fix: use getArrayCopy for assertMatchesJsonSchema #3807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alanpoulain
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

This PR is part of a set of PR whose purpose is to make the assertions assertMatchesResourceItemJsonSchema and assertMatchesResourceCollectionJsonSchema work correctly.
The PR are:

Without doing this, the refs are not correctly expanded and the value is not correctly validated against the JSON Schema.
It's because of this line:
https://github.com/justinrainbow/json-schema/blob/fa4d2d3c1e40a222ded125b679891086c9a6c7d6/src/JsonSchema/SchemaStorage.php#L99

It seems that property_exists on an ArrayObject is not considering a key as a property.
See: https://3v4l.org/60Mbh

@soyuka
Copy link
Member

soyuka commented Nov 2, 2020

thanks @alanpoulain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants