-
Notifications
You must be signed in to change notification settings - Fork 354
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
"format":"uri" still OK after recent changes? #418
Comments
@erayd
Doesn't I just cannot get passed the fact that now every string passes as a |
You're right. The case that led me to make this change actually turned out to be a meta-schema bug; I don't have the handy right now (not at my desk), but will find out for you tomorrow. This change will be reverted. |
*don't have the link handy right now, but will find it tomorrow. |
@erayd OK, thanks.. So is the change to remove that As I see, the |
The change is bigger - relative URI (i.e. URI references) should not be allowed at all for the |
Right, now that I'm back at my desk...
Following spec issues 310 & 177:
In order to ensure that the
|
@narcoticfresh / @bighappyface |
Hi guys..
First, thanks for the active work on this project, it's very nice to see that much activity going on here ,-)
An update from
5.1.0
to5.2.0
broke one of our projects unit tests and i'm not sure if our test expectations are wrong - or the changes here ;-)The schema
Given this simple schema:
The problem
Our unit tests expects the string
jjj--no-url
not to be a valid url.. but apparently now, it is ;-)This was changed recently in commit 5e92df0
For us, this is kinda of a problem, we don't regard (and who would?)
jjj--no-url
as a valid url..So if i pass the string
jjj--no-url
as an url, it will land in this condition of theif
:https://github.com/justinrainbow/json-schema/blob/5.2.0/src/JsonSchema/Constraints/FormatConstraint.php#L96
The question
Isn't the check to lean? If we have a look at the line:
So this basically means that any string will pass (as long it doesn't have invalid filename parts) as it gets prefixed with a scheme and a host (thus seen as a relative part)..
I checked this, even the string
a
will pass.IMHO, this makes the
uri
check obsolete and wrong. If we prepend scheme and host for the user to pass the url check, the user really didn't provide a correct url..So is this what is really expected, that any string passes the
uri
format?Thanks ;-)
The text was updated successfully, but these errors were encountered: