bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

Feature request: Trigger "warning" if specific value encountered in JSON field

Open sappelhoff opened this issue 5 years ago • 4 comments
trafficstars

We use the schema for JSON validation and that's great -> however, for some failures (or use cases), I would like to send a specific warning to the user.

Example:

  • User tries to specify RAS in EEGCoordinateSystem
  • RAS is not on the [list of restricted keywords], the schema errors and prints a list of accepted values
  • among the printed list, there is Other, and because it seems like the only fit, the user picks Other and moves on

--> that's a problem, because if Other is specified in EEGCoordinateSystem, I want the user to specify a string for the EEGCoordinateSystemDescription field to explain in detail what Other means.

So ideally, the validator would provide a re-usable structure to check:

  • if value A in field B of any JSON, do action X
  • where Z could be either of:
    • send a specifically phrased warning
    • check value in field C ... and if that value is D, pass ... else raise specifically phrased warning

Does that sound reasonable?

sappelhoff avatar Sep 16 '20 09:09 sappelhoff