json-schema
json-schema copied to clipboard
fix: replace filter_var for uri and uri-reference to userland code to be RFC 3986 compliant
This pull request introduces new validators for URI and relative references and integrates them into the FormatConstraint class. The changes also include corresponding unit tests to ensure the validators work as expected.
New Validators:
src/JsonSchema/Tool/Validator/UriValidator.php: Added a new classUriValidatorto validate URIs according to RFC 3986 and RFC 5322 formailto:URIs.src/JsonSchema/Tool/Validator/RelativeReferenceValidator.php: Added a new classRelativeReferenceValidatorto validate relative references according to RFC 3986.
Integration into FormatConstraint:
src/JsonSchema/Constraints/FormatConstraint.php: Integrated the newUriValidatorandRelativeReferenceValidatorinto thecheckmethod to replace the previous inline validation logic forurianduri-referenceformats.
Unit Tests:
tests/Tool/Validator/UriValidatorTest.php: Added unit tests forUriValidatorto ensure it correctly validates valid and invalid URIs.tests/Tool/Validator/RelativeReferenceValidatorTest.php: Added unit tests forRelativeReferenceValidatorto ensure it correctly validates valid and invalid relative references.
Closing keywords
fixes https://github.com/jsonrainbow/json-schema/issues/685