You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feel free to open a pull request to add more examples!
14
+
15
+
## How can I contribute to nf-schema?
16
+
17
+
Take a look at the [contribution instruction](../contributing/setup.md) to get started with contributing to nf-schema.
18
+
19
+
## Where can I ask other questions?
20
+
21
+
If you have a question that is not addressed in this FAQ, feel free to create an issue on the nf-schema repository [here](https://github.com/nextflow-io/nf-schema/issues) or ask your question in the `#nf-schema` Slack channel on the [Nextflow Slack](https://www.nextflow.io/slack-invite.html) or the [nf-core Slack](https://nf-co.re/join/slack)
This section of the documentation contains a couple of common errors encountered while implementing nf-schema or using pipelines with the plugin and how to solve them.
4
+
5
+
## An integer value is failing because a string value was expected
6
+
7
+
Pipelines often use some kind of identifier field in their sample sheet, that usually gets `string` as the expected input. This can cause some issues when using CSV and TSV sample sheets since the types of all values are automatically inferred for these file types. Meaning that a value in the `sample` field that has `123` as the value would result in an integer instead of a string. Following error would be shown in this case:
8
+
9
+
```
10
+
-> Entry 1: Error for field 'sample' (123): Value is [integer] but should be [string]
11
+
```
12
+
13
+
There are multiple ways to solve this issue as pipeline developers and as pipeline users. The solutions will be listed from best options to worst:
14
+
15
+
### Pipeline user
16
+
17
+
- Option 1: Use a YAML or JSON file as sample sheet if that is allowed by the pipeline and make sure to quote the value. (`'123'` in the case of the example above)
18
+
- Option 2: Activate [lenient validation mode](../configuration/configuration.md#lenientmode). Keep in mind that this will enable lenient validation for **ALL** validations in the pipeline.
19
+
20
+
### Pipeline developer
21
+
22
+
- Option 1: Modify `"type": "string"` in the affected JSON schema to `"type": ["string", "integer"]`. Make sure that integer values don't break anything in your pipeline. The easiest way to ensure compatibility is to cast the value to a string after converting the sample sheet to a list.
23
+
- Option 2: Enforce usage of JSON and YAML sample sheets by only allowing files ending in `.yml`, `.yaml` or `.json` to be used.
0 commit comments