-
Notifications
You must be signed in to change notification settings - Fork 25
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
V3.0-RC Schemas #79
V3.0-RC Schemas #79
Conversation
A few meta comments:
I will update this list as I am reviewing this PR!
|
Noted on using multiple commits next time, that was my bad! As for gbfs.json, yes this is correct. The PR for internationalization removes the need to duplicate your feed per language, so that nesting level is gone. |
Sounds good! |
v3.0-RC/system_information.json
Outdated
} | ||
} | ||
}, | ||
"anyOf": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here my understanding of the spec is that license_id
and license_URL
can both be left blank and that license_URL
must not be provided if license_id
is present.
I've tested:
license_id
andlicense_URL
are present -> invalid ✅- only
license_id
is present -> valid ✅ - only
license_url
is present -> valid ✅ license_id
andlicense_URL
are not present- > invalid ❌ (we want this to be valid)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we need something else than anyOf
to validate this 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think perhaps oneOf
might be the proper solution and not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking for help from @testower or @AntoineAugusti (or anyone else!), oneOf
doesn't seem to solve the problem, since it still requires one of the options, I can't seem to determine how to represent one of or none.
Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://stackoverflow.com/a/38799750/2645887
Maybe
"dependencies": {
"license_url": { "not": { "required": ["license_id"] } },
"license_id": { "not": { "required": ["license_url"] } }
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work! Merci @AntoineAugusti!! @isabelle-dr do you want to confirm as well or should I make the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josee-sabourin I've just pushed a commit that fixes this problem, please confirm!
It does the following:
- license_id and license_URL are present -> invalid
- onlylicense_id is present -> valid
- onlylicense_url is present -> valid
- license_id and license_URL are not present- > invalid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed!
}, | ||
"opening_hours": { | ||
"description": "Hours and dates of operation for the system in OSM opening_hours format. (added in v3.0-RC)", | ||
"type": "string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you look into using a Regex expression to validate the opening hour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have, but I have not been able to find one that works for all possibilities.
Okay, I am finished with this review! I've added two comments in-line.
|
Some answers for you:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to go!
Awesome work @josee-sabourin
New directory of schemas for v3.0-RC.
Specifically looking for input on
system_information.license_url
andlicense _id
.Used
anyOf
similarly to the way it's been used invehicle_status
withlat
,lon
andstation_id
in previous versions. Is that the best way of representing this?