Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 187c018

Browse files
authored
Merge pull request #158 from mirpedrol/fix-docs
format code blocks and admonitions
2 parents 8128304 + fef591e commit 187c018

File tree

1 file changed

+105
-8
lines changed

1 file changed

+105
-8
lines changed

docs/migration_guide.md

Lines changed: 105 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.or
3030
This will replace the old schema draft specification (`draft-07`) by the new one (`2020-12`), and the old keyword `definitions` by the new notation `defs`.
3131

3232
!!! note
33-
Repeat this command for every JSON schema you use in your pipeline. e.g. for the default samplesheet schema:
34-
`bash sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/defs/g' assets/schema_input.json `
33+
34+
Repeat this command for every JSON schema you use in your pipeline. e.g. for the default samplesheet schema:
35+
`bash sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/defs/g' assets/schema_input.json `
3536

3637
If you are using any special features in your schemas, you will need to update your schemas manually. Please refer to the [JSON Schema draft 2020-12 release notes](https://json-schema.org/draft/2020-12/release-notes) and [JSON schema draft 2019-09 release notes](https://json-schema.org/draft/2019-09/release-notes) for more information.
3738

@@ -44,25 +45,121 @@ When you use `unique` in your schemas, you should update it to use `uniqueItems`
4445
If you used the `unique:true` field, you should update it to use `uniqueItems` like this:
4546

4647
=== "Before v2.0"
47-
`json hl_lines="9" { "$schema": "http://json-schema.org/draft-07/schema", "type": "array", "items": { "type": "object", "properties": { "sample": { "type": "string", "unique": true } } } } `
48+
49+
```json hl_lines="9"
50+
{
51+
"$schema": "http://json-schema.org/draft-07/schema",
52+
"type": "array",
53+
"items": {
54+
"type": "object",
55+
"properties": {
56+
"sample": {
57+
"type": "string",
58+
"unique": true
59+
}
60+
}
61+
}
62+
}
63+
```
4864

4965
=== "After v2.0"
50-
`json hl_lines="12" { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "array", "items": { "type": "object", "properties": { "sample": { "type": "string" } } }, "uniqueItems": true } `
66+
67+
```json hl_lines="12"
68+
{
69+
"$schema": "https://json-schema.org/draft/2020-12/schema",
70+
"type": "array",
71+
"items": {
72+
"type": "object",
73+
"properties": {
74+
"sample": {
75+
"type": "string"
76+
}
77+
}
78+
},
79+
"uniqueItems": true
80+
}
81+
```
5182

5283
If you used the `unique: ["field1", "field2"]` field, you should update it to use `uniqueEntries` like this:
5384

5485
=== "Before v2.0"
55-
`json hl_lines="9" { "$schema": "http://json-schema.org/draft-07/schema", "type": "array", "items": { "type": "object", "properties": { "sample": { "type": "string", "unique": ["sample"] } } } } `
86+
87+
```json hl_lines="9"
88+
{
89+
"$schema": "http://json-schema.org/draft-07/schema",
90+
"type": "array",
91+
"items": {
92+
"type": "object",
93+
"properties": {
94+
"sample": {
95+
"type": "string",
96+
"unique": ["sample"]
97+
}
98+
}
99+
}
100+
}
101+
```
56102

57103
=== "After v2.0"
58-
`json hl_lines="12" { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "array", "items": { "type": "object", "properties": { "sample": { "type": "string" } } }, "uniqueEntries": ["sample"] } `
104+
105+
```json hl_lines="12"
106+
{
107+
"$schema": "https://json-schema.org/draft/2020-12/schema",
108+
"type": "array",
109+
"items": {
110+
"type": "object",
111+
"properties": {
112+
"sample": {
113+
"type": "string"
114+
}
115+
}
116+
},
117+
"uniqueEntries": ["sample"]
118+
}
119+
```
59120

60121
### Updating `dependentRequired` keyword
61122

62123
When you use `dependentRequired` in your schemas, you should update it like this:
63124

64125
=== "Before v2.0"
65-
`json hl_lines="12" { "$schema": "http://json-schema.org/draft-07/schema", "type": "object", "properties": { "fastq_1": { "type": "string", "format": "file-path" }, "fastq_2": { "type": "string", "format": "file-path" "dependentRequired": ["fastq_1"] } } } `
126+
127+
```json hl_lines="12"
128+
{
129+
"$schema": "http://json-schema.org/draft-07/schema",
130+
"type": "object",
131+
"properties": {
132+
"fastq_1": {
133+
"type": "string",
134+
"format": "file-path"
135+
},
136+
"fastq_2": {
137+
"type": "string",
138+
"format": "file-path",
139+
"dependentRequired": ["fastq_1"]
140+
}
141+
}
142+
}
143+
```
66144

67145
=== "After v2.0"
68-
`json hl_lines="14 15 16" { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "fastq_1": { "type": "string", "format": "file-path" }, "fastq_2": { "type": "string", "format": "file-path" } }, "dependentRequired": { "fastq_2": ["fastq_1"] } } `
146+
147+
```json hl_lines="14 15 16"
148+
{
149+
"$schema": "https://json-schema.org/draft/2020-12/schema",
150+
"type": "object",
151+
"properties": {
152+
"fastq_1": {
153+
"type": "string",
154+
"format": "file-path"
155+
},
156+
"fastq_2": {
157+
"type": "string",
158+
"format": "file-path"
159+
}
160+
},
161+
"dependentRequired": {
162+
"fastq_2": ["fastq_1"]
163+
}
164+
}
165+
```

0 commit comments

Comments
 (0)