-
Notifications
You must be signed in to change notification settings - Fork 231
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
Policy: rule_unit is optional but does not define a default #434
Comments
Hi @ascherkus! When designing Re: #389, we are able to generate json schemas based on our typedefs, but are still working on finding a nice way to tie that in with the existing schema generation tool that's in the MDS repo. Our intent is to cut a PR for that at some point. In the meantime, a sneak preview for generating the schemas...
I'm not sure of the best way to express this in the spec, so open to suggestions. |
Thanks for the pointers! IIUC, based on the typescript definition it looks like I've got a related, broader question I'll ask the mailing list re: the JSON schema definition bit. |
Noting that our PR for #472 will contain some additional rule_units. I want to be sure to keep the new units inline with whatever the planned resolution of this issue is. Anything I should do now? |
|
@Karcass Did a PR get made for this, and if not, should we move to 1.1.0? |
Working to resolve this now with #539. |
Most of this is resolved with PR #539. One thing that wasn't was picking just one speed per time unit, and kept both mph and kph. Please open another issue @ascherkus after you review all the changes in context if you'd like to revisit something. |
Describe the bug
Most of the optional policy fields specify what the default value is when not present (which is fantastic!)
However
rule_unit
is optional, but does not specify what the default behaviour is.To Reproduce
Steps to reproduce the behavior: N/A
Expected behavior
I'd expect either:
rule_unit
to be required depending onrule_type
In general, I lean towards explicitness in this instances so my vote would be (2).
I worry about the complexity of (1) growing over time, especially since we've already introduced metric vs. imperial units (kph and mph). To keep it simple we'd either have to:
a) Remove
kph
(ormph
😉)b) Stick to a single unit globally (e.g., kph) as the default
c) Go down the path of having the default change based on locale (e.g., default
rule_unit
is kph if these policies are for regions in Canada)d) Some other idea that I haven't thought of off the top of my head
Again, I think (2) with some tests as well as a proper schema (see #389) would go a long way to clarifying things.
Additional context
Came across this while prototyping a tool for #423.
Happy to send out a PR - just want clarification before doing so!
The text was updated successfully, but these errors were encountered: