-
Notifications
You must be signed in to change notification settings - Fork 192
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
Validate nextflow_schema.json that parameter type matches actual value #823
Comments
I agree things like this should be captured by It basically should already be captured be the schema check in the linting function .... maybe the schema validation doesn't look at the default values. |
Yep adding a validation check for the default parameter should solve that problem. Currently only the schema format is checked, which doesn't validate the default parameters it seems. Also pointed to the |
Made a draft PR that should fix this problem #830 Just draft for now because I want to go over this a bit more and test it but I think it should be fine. Not too complicated. |
Is your feature request related to a problem? Please describe
I got a bug report in eager where although a params.json specifies a parameter to be an integer, it is formatted in the schema as a string. However in a validation check in the eager code, that parameter is checked against an integer.
i.e.
Schema specifies integer
But building params.json, it is is in quotes
But the check is outside quotes:
After discussion with @KevinMenden we identified that actually the issue likely stems from the fact the eager schema is very old. Probably at the time, the actual format of the value did not match the specified type - and this has since not been checked.
Describe the solution you'd like
During linting (at some point), the nextflow_schema.json should check that the format of the value matches the specified type.
For example, if the parameter type is specified to be a integer, check there are no quotes in the default.
This is important given some people may occasionally modify their JSONs out the build schema and make this mistake.
Describe alternatives you've considered
Manually fix the eager json (which I will do anyway).
Additional context
https://nfcore.slack.com/archives/CUC8PPDL2/p1610343655159600
The text was updated successfully, but these errors were encountered: