Skip to content

Conversation

@scaytrase
Copy link
Member

Fixes #154
Fixes #146

"php": ">=7.2",
"ext-json": "*",
"cebe/php-openapi": "^1.3",
"cebe/php-openapi": "^1.6",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your fix should also work with older versions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test from #146 fails because of lack of logic invented here cebe/php-openapi#132
So in order to make this test pass - we should have ^1.6.0

@scaytrase scaytrase merged commit c3daf7c into master Feb 10, 2022
@scaytrase scaytrase deleted the bugfix/fix-schema-nullable branch February 10, 2022 13:54
tunezilla added a commit to tunezilla/openapi-test-validation that referenced this pull request Aug 2, 2022
try {
// These keywords are not part of the JSON Schema at all (new to OAS)
(new Nullable($schema))->validate($data, $schema->nullable);
(new Nullable($schema))->validate($data, $schema->nullable ?? true);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I didn't understand why we want nullable true by default instead of false ?)

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.

$schema->nullable can be null as of cebe/php-openapi 1.6 nullable oneOf/anyOf value rejected

4 participants