NextCenturyCorporation / itm-scenario-validator

1 stars 0 forks source link

if f1 is v1 and f2 is v2, then f3 must be [opt] #9

Closed kaitlyn-sharo closed 8 months ago

kaitlyn-sharo commented 8 months ago

Does not require field3 if conditions are met by field1 and field2. Does not consider requirements of fields at all, only checks:

Is expandable to more than 2 conditions and more than 1 requirement. Check the README for formatting advice.

kaitlyn-sharo commented 8 months ago

Are multiple values in any of the fields supposed to be supported? E.g., can you say, "military_branch": ["US Army", "US Navy"] to match either value? It doesn't appear so, and that's okay. But it's less clear in the case of the requirement field. Maybe the only action is to clarify in the README where single/multiple values are allowed for the various fields.

Related, when I specified a military_branch of ["US Army"] instead of "US Army", it didn't work. I had to remove the brackets. One possibility is to log something (Info? Warn?) if you've specified a list of values if only a single value is supported.

As far as I know, it's not a requirement at the moment to support multiple values for field1 or field2.

Hmmm, if I allowed multiple values for field1 and field2 it might be more efficient, and it would certainly make dependencies.json cleaner. I'll give it a try but as of right now, no that's not allowed but requirement can have multiple allowed values. If I can't get the multiple values quickly, since it's not a requirement for now, I'll just update the documentation

kaitlyn-sharo commented 8 months ago

Are multiple values in any of the fields supposed to be supported? E.g., can you say, "military_branch": ["US Army", "US Navy"] to match either value? It doesn't appear so, and that's okay. But it's less clear in the case of the requirement field. Maybe the only action is to clarify in the README where single/multiple values are allowed for the various fields. Related, when I specified a military_branch of ["US Army"] instead of "US Army", it didn't work. I had to remove the brackets. One possibility is to log something (Info? Warn?) if you've specified a list of values if only a single value is supported. As far as I know, it's not a requirement at the moment to support multiple values for field1 or field2.

Hmmm, if I allowed multiple values for field1 and field2 it might be more efficient, and it would certainly make dependencies.json cleaner. I'll give it a try but as of right now, no that's not allowed but requirement can have multiple allowed values. If I can't get the multiple values quickly, since it's not a requirement for now, I'll just update the documentation

Sorry, had to take a quick KScope break. I think I've completed the multiple-values-allowed. Please check to make sure this is what you were talking about.

kaitlyn-sharo commented 8 months ago

Looks good except for one missing set of apostrophes at the end: Key 'rank_title' must have one of the following values ['Lieutenant', 'Captain'] because 'state.characters[0].demographics' has key-value pairs ('rank': 'O-3'); ('mi litary_branch': 'US Navy'), but instead value is Corporal

Fixed. Pesky apostrophes...