673 Commits

Author SHA1 Message Date
Danny van der Sluijs
a8c008885d
fix: only check minProperties or maxProperties on objects (#802)
`minProperties` and `maxProperties` are only applicable on objects.

https://www.learnjsonschema.com/draft4/validation/minproperties/ 

https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.5.4.2
2025-03-07 14:35:34 +01:00
Danny van der Sluijs
dff04e3c7c docs: release 6.2.1 6.2.1 2025-03-06 22:27:10 +01:00
Danny van der Sluijs
949a4d5c89
fix: allow items: true to pass validation (#801)
Fixes #799
2025-03-06 22:25:30 +01:00
Danny van der Sluijs
bb68276a3b
feat: include actual count in collection constraint errors (#797)
Includes the actual count in min/maxItems.

Fixes https://github.com/jsonrainbow/json-schema/issues/501
2025-02-27 12:06:44 +01:00
Danny van der Sluijs
460c0a0940 docs: release 6.2.0 6.2.0 2025-02-26 21:58:15 +01:00
Danny van der Sluijs
d9d665f276
refactor: cleanup redundant checks (#796)
Fixes #793 removing PHP 5.5 and HHVM checks
2025-02-26 21:36:44 +01:00
Aistis
b62fea73bd
fix: property is passed as integer and cannot be accessed (#784) 2025-02-26 20:15:26 +01:00
Danny van der Sluijs
a94f60c332
fix: create deep copy before checking each sub schema in oneOf when only check_mode_apply_defaults is set (#795)
Fixes https://github.com/jsonrainbow/json-schema/issues/510
2025-02-26 19:41:16 +01:00
Danny van der Sluijs
649793d2b9
Correctly set the schema ID when passing it as assoc array (#794)
Replaces #769 due to lack of permissions to update PR
Closes https://github.com/jsonrainbow/json-schema/issues/767.

---------

Co-authored-by: Dalibor Karlović <dalibor.karlovic@sigwin.hr>
2025-02-26 16:47:32 +01:00
Danny van der Sluijs
44066980b7
fix: Create deep copy before checking each sub schema in anyOf (#792)
Fixes https://github.com/jsonrainbow/json-schema/issues/711
2025-02-26 15:40:07 +01:00
Danny van der Sluijs
7eea9e4f11
fix: Create deep copy before checking each sub schema in oneOf (#791)
This PR creates a deep copy of the value before passing it by reference
for validating sub schemas of a `oneOf` with type coercion enabled.

Fixes #790
2025-02-26 12:11:20 +01:00
Danny van der Sluijs
ec0eab03f2
fix: Upgrade php cs fixer to latest (#783)
Fixes #598
2025-02-21 10:50:06 +01:00
Danny van der Sluijs
f84193ea05
fix: add required permissions for welcome action (#789)
This PR adds the required permissions for making comments on the issues
and pull requests

References:
-
https://github.com/jsonrainbow/json-schema/actions/runs/13372875791/job/37345272696#step:2:1
-
https://github.com/wow-actions/welcome/issues/9#issuecomment-2663235613
2025-02-21 10:31:03 +01:00
Danny van der Sluijs
7660882388
feat: welcome first time contributors (#782)
* feat: welcome first time contributers

* docs: add changelog entry
2025-02-10 21:58:50 +01:00
Jack Worman
afee666c00
More-phpstan-typing (#781) 2025-02-10 20:58:59 +01:00
Jack Worman
56f34b8ced
Use phpstan's int-mask-of<T> (#779)
* Better phpstan typing

* Better phpstan typing
2025-02-06 08:10:30 +01:00
Danny van der Sluijs
f7d78c345d docs: Release 6.1.0 6.1.0 2025-02-04 12:13:26 +01:00
Danny van der Sluijs
97e7e4d772
docs: add contribution and contributor information (#771)
* docs: add contribution and contributor information

* docs: add changelog entry
2025-01-28 11:39:45 +01:00
Dieter Beck
caa0c6c9c8
fix: Succeed format validation if the type is not in the set of given instance types (#773) (#773)
See https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.7.1: If the type of the instance to validate is not in this set, validation for this format attribute and instance SHOULD succeed.
2025-01-28 11:35:36 +01:00
Dieter Beck
d212ecacc2
Remove obsolete check if FILTER_FLAG_EMAIL_UNICODE is defined (#772)
* Remove obsolete check because PHP 7.1 or lower is not supported anymore

* Refresh phpstan baseline

* Add changelog
2025-01-20 21:33:40 +01:00
Danny van der Sluijs
14e41d82de
refactor: Cleanup test from @param annotations (#768)
* refactor: Cleanup test from @param annotations

* docs: add changelog entry
2025-01-10 11:16:00 +01:00
Danny van der Sluijs
377231495a
Raise minimum level php enum (#766)
* build: raise minimum level of marc-mabe/php-enum

* docs: add changelog entry
2024-11-21 22:19:10 +01:00
Danny van der Sluijs
b5c8c9ee12
refactor: add declare strict_types to all classes in ./src (#758)
* refactor: add declare strict_types to all classes in ./src

* fix: correct regression from adding declare strict_types

* refactor: enforce string at datetime casting

* docs: add changelog entry
2024-11-21 22:10:43 +01:00
Danny van der Sluijs
63d6369385
build: include php 8.4 in workflow (#765) 2024-11-21 22:01:07 +01:00
Tac Tacelosky
3fe73adcee
tweak spacing (#763)
* tweak spacing

tweak spacing so array keys are indented the same.

* docs: add changelog entry

---------

Co-authored-by: Danny van der Sluijs <danny.vandersluijs@icloud.com>
2024-11-21 21:57:07 +01:00
Danny van der Sluijs
ba2d3c7700
fix: correct phpstan baseline (#764) 2024-11-21 21:46:33 +01:00
Danny van der Sluijs
24e7cbf8c5
refactor: add visibility modifiers to class constants (#757)
* refactor: add visibility modifiers to class constants

https://wiki.php.net/rfc/class_const_visibility

* docs: add changelog entry
2024-10-21 11:37:15 +02:00
Ali Yousefi
73e38269ed
Update: add ext-json to composer.json to ensure JSON extension availa… (#759)
* Update: add ext-json to composer.json to ensure JSON extension availability

* docs: add changelog entry

---------

Co-authored-by: Danny van der Sluijs <danny.van.der.sluijs@infi.nl>
2024-10-21 11:13:21 +02:00
Witold Wasiczko
f0b02264a3
Invalid string validation (#704)
* Add test case for invalid string type validation

* docs: add changelog entry

---------

Co-authored-by: Danny van der Sluijs <danny.van.der.sluijs@infi.nl>
2024-09-20 13:40:40 +02:00
Niklas Correnz
eac0893905
Fix wrong combined paths when traversing upwards. Fixes #557 (#652)
* Fix wrong combined paths when traversing upwards. Fixes #557

* docs: add changelog entry

---------

Co-authored-by: Danny van der Sluijs <danny.van.der.sluijs@infi.nl>
2024-09-20 13:29:14 +02:00
Danny van der Sluijs
60488b2317
Resolve deprecations: Optional parameter $... declared before required parameter $... (#752)
* fix: remove default value to resolve deprecations notice

* docs: add changelog entry
2024-09-13 15:28:30 +02:00
Jordi Boggiano
5b3bd2b1b6
Increase phpstan level to 8 with baseline to swallow existing errors (#673)
* Increase phpstan level to 8 with baseline to swallow existing errors

* Add phpstan to composer.json

* docs: a changelog entry

---------

Co-authored-by: Danny van der Sluijs <danny.van.der.sluijs@infi.nl>
2024-09-13 15:20:41 +02:00
Danny van der Sluijs
23c8551197
Add return types to test suite (#748)
* refactor: Add return types in the test suite

* docs: Add changelog entry
2024-08-30 15:09:12 +02:00
Danny van der Sluijs
cddbef1378
refactor: Replace traditional syntax array with short syntax array (#747)
* refactor: Replace traditional syntax array with short syntax array

* docs: Update changelog
2024-08-27 09:30:55 +02:00
Danny van der Sluijs
2eb0deffe8
Extend pipeline for newer versions php (#746)
* ci: Add PHP 8.0 and greater to build matrix

* ci: Remove PHP 5.3 - 7.1 from workflows

* build: Require minimum PHP 7.2

* build: Upgrade to PHPUnit 8.5

* refactor: Add now required void return types for setup() methods

* build: Include phpspec/prophecy dependency

* refactor: Replace setExpectedException with expectException/expectExceptionMessage

* refactor: Replace @expectedException annotation for expectException method

* refactor: Replace assertInternalType for assertIsArray

* refactor: Replace getMock for createMock

* test: Improve test assertions

* fix: Solve return type issues with Objectiterator (port of #682)

See https://github.com/jsonrainbow/json-schema/pull/682

* build: Update icecave/parity to ^3.0 as 1.0 uses deprecated each() method

* style: Correct code style issues

* fix: Fix deprecation notices found from GHA workflow run

See https://github.com/jsonrainbow/json-schema/actions/runs/10216569969/job/28268331091

* fix: Add fallback to empty string when null value is passed in UriResolver::parse

* fix: Port #717: Fixes for implicit nullability deprecation

See https://github.com/jsonrainbow/json-schema/pull/717

* ci: Avoid GHA run on each push and pull request; Include PHP 8.4 in matrix

* ci(Drop-PHP-8.4-from-matrix): This PR adds phpspec/prophecy as an explicit dependency which is restrictive and doesnt support upcoming PHP versions

* refactor: Replace ternary variable with explicit cast to string
2024-08-27 09:00:10 +02:00
Danny van der Sluijs
985840f9ec
test: Correct casing of paths used in tests (#745)
* test: Correct casing of paths used in tests

* docs: Add changelog entry
2024-08-05 08:44:35 +02:00
Danny van der Sluijs
3c49c66918
Add missing property in uri resolver test (#743)
* fix: Add missing property definition

* docs: Add changelog entry
2024-08-02 15:11:50 +02:00
Viktor Szépe
1973ab58e6
Fix pugx badges in README (#742)
* Fix pugx badges in README

* docs: Add changelog entry

* fix: Correct accidently added file

---------

Co-authored-by: Danny van der Sluijs <danny.vandersluijs@icloud.com>
2024-07-31 21:11:54 +02:00
Danny van der Sluijs
4aa6fd383e
Correct misconfigured mocks in JsonSchema\Tests\Uri\UriRetrieverTest (#741)
* test: Correct misconfigured mocks

* test: Refactor to use willReturn() method

* test: Make use of already imported classname

* test: Ignore return value when exception is expected to be thrown

* test: Mock complete interface

* docs: Add changelog entry
2024-07-30 21:27:50 +02:00
Danny van der Sluijs
a38c6198d5 docs: Add release version & data to changelog 6.0.0 2024-07-30 19:49:21 +02:00
Danny van der Sluijs
957ac43c49
Merge pull request #732 from jsonrainbow/Prepare-release-6
docs: Add changelog and upgrade documentation for version 6.0
6.0.0-beta
2024-07-09 09:19:24 +02:00
Danny van der Sluijs
daee7cca09 docs: Add changelog and upgrade documentation 2024-07-09 09:15:26 +02:00
Danny van der Sluijs
47708f50b5
Merge pull request #709 from DannyvdSluijs/Issue-694
Addresses Content-Type mismatch on HTTP 301 Moved Permanently with FileGetContents
2024-05-27 13:57:01 +02:00
Danny van der Sluijs
db59a8d73b
Update references to jsonrainbow (#725)
* Fix: Composer.json homepage

As can be read in https://github.com/jsonrainbow/json-schema/issues/658,
the repository has been moved. Update the composer.json homepage
instruction to point to the new location.

* docs: Update remaining references to jsonrainbow

---------

Co-authored-by: Floris Luiten <floris.luiten@tweakers.net>
2024-05-27 09:47:04 +12:00
Danny van der Sluijs
4f0e8f2e1d style: Correct code style violations 2024-05-26 21:23:33 +02:00
Danny van der Sluijs
4479f6e308 fix: Parse headers in reverse order to match with last header avoiding matches on HTTP 301 redirect headers which are listed first 2024-05-26 21:17:20 +02:00
Danny van der Sluijs
e6ea5223e3 test: Remove file_get_contents override and incorrect/invaluable tests
Overriding file_get_contents introduces different behaviour from the native function, such as the $http_response_headers missing. Removing the override revealed two test (testing a specific return path of the file_get_contents method rather then testing the behaviour or result of the subject under test) which had different behaviour between the test and runtime, therefor these tests have been removed.
2024-05-26 21:17:19 +02:00
Danny van der Sluijs
b7475c066e test: Add test failure 2024-05-26 21:17:19 +02:00
Jordi Boggiano
9e3c63154e
Merge pull request #710 from DannyvdSluijs/pr-641-alternative
refactor: Remove dead block of code
2024-05-21 23:33:48 +02:00
Jordi Boggiano
42011a682a
Merge pull request #722 from DannyvdSluijs/Update_GitHub_actions_version
ci: Bump to v4 versions of GitHub actions
2024-05-21 23:30:36 +02:00