|
34 | 34 | "properties": { |
35 | 35 | "scanning": { |
36 | 36 | "type": "array", |
37 | | - "description": "List of glob patterns to skip files from scanning", |
| 37 | + "description": "List of glob patterns (gitignore format) to exclude files from scanning. Patterns are matched relative to the scan root directory.\n\n- A trailing `/` matches a directory\n- `*` matches anything except `/`\n- `**` matches zero or more directories\n- `[0-9]` matches character ranges\n- `?` matches a single character except `/`\n- Leading `!` negates a pattern", |
38 | 38 | "items": { |
39 | 39 | "type": "string", |
40 | 40 | "examples": [ |
|
44 | 44 | "path/to/file.c", |
45 | 45 | "path/to/another/file.py", |
46 | 46 | "**/*.ts", |
47 | | - "**/*.json" |
| 47 | + "**/*.json", |
| 48 | + "!important.log", |
| 49 | + "temp/", |
| 50 | + "debug[0-9]*.txt" |
48 | 51 | ] |
49 | 52 | }, |
50 | 53 | "uniqueItems": true |
51 | 54 | }, |
52 | 55 | "fingerprinting": { |
53 | 56 | "type": "array", |
54 | | - "description": "List of glob patterns to skip files from fingerprinting", |
| 57 | + "description": "List of glob patterns (gitignore format) to exclude files from fingerprinting. Patterns are matched relative to the scan root directory.\n\n- A trailing `/` matches a directory\n- `*` matches anything except `/`\n- `**` matches zero or more directories\n- `[0-9]` matches character ranges\n- `?` matches a single character except `/`\n- Leading `!` negates a pattern", |
55 | 58 | "items": { |
56 | 59 | "type": "string", |
57 | 60 | "examples": [ |
|
61 | 64 | "path/to/file.c", |
62 | 65 | "path/to/another/file.py", |
63 | 66 | "**/*.ts", |
64 | | - "**/*.json" |
65 | | - ] |
66 | | - }, |
67 | | - "uniqueItems": true |
68 | | - }, |
69 | | - "dependencies": { |
70 | | - "type": "array", |
71 | | - "description": "List of glob patterns to skip dependency files from dependency analysis", |
72 | | - "items": { |
73 | | - "type": "string", |
74 | | - "examples": [ |
75 | | - "vendor/**", |
76 | | - "third_party/", |
77 | | - "node_modules/**" |
| 67 | + "**/*.json", |
| 68 | + "!important.log", |
| 69 | + "temp/", |
| 70 | + "debug[0-9]*.txt" |
78 | 71 | ] |
79 | 72 | }, |
80 | 73 | "uniqueItems": true |
|
87 | 80 | "properties": { |
88 | 81 | "scanning": { |
89 | 82 | "type": "array", |
| 83 | + "description": "Rules for skipping files based on their size during scanning. Each rule combines glob patterns with min/max byte thresholds.", |
90 | 84 | "items": { |
91 | 85 | "type": "object", |
92 | 86 | "properties": { |
|
115 | 109 | "description": "Maximum size of the file in bytes" |
116 | 110 | } |
117 | 111 | } |
118 | | - } |
| 112 | + }, |
| 113 | + "examples": [ |
| 114 | + [ |
| 115 | + { |
| 116 | + "patterns": ["*.log", "!important.log"], |
| 117 | + "min": 512, |
| 118 | + "max": 5242880 |
| 119 | + } |
| 120 | + ] |
| 121 | + ] |
119 | 122 | }, |
120 | 123 | "fingerprinting": { |
121 | 124 | "type": "array", |
| 125 | + "description": "Rules for skipping files based on their size during fingerprinting. Each rule combines glob patterns with min/max byte thresholds.", |
122 | 126 | "items": { |
123 | 127 | "type": "object", |
124 | 128 | "properties": { |
125 | 129 | "patterns": { |
126 | 130 | "type": "array", |
127 | 131 | "description": "List of glob patterns to apply the min/max size rule", |
128 | 132 | "items": { |
129 | | - "type": "string" |
130 | | - }, |
131 | | - "examples": [ |
132 | | - "path/to/folder", |
133 | | - "path/to/folder/**", |
134 | | - "path/to/folder/**/*", |
135 | | - "path/to/file.c", |
136 | | - "path/to/another/file.py", |
137 | | - "**/*.ts", |
138 | | - "**/*.json" |
139 | | - ] |
| 133 | + "type": "string", |
| 134 | + "examples": [ |
| 135 | + "path/to/folder", |
| 136 | + "path/to/folder/**", |
| 137 | + "path/to/folder/**/*", |
| 138 | + "path/to/file.c", |
| 139 | + "path/to/another/file.py", |
| 140 | + "**/*.ts", |
| 141 | + "**/*.json" |
| 142 | + ] |
| 143 | + } |
140 | 144 | }, |
141 | 145 | "min": { |
142 | 146 | "type": "integer", |
|
147 | 151 | "description": "Maximum size of the file in bytes" |
148 | 152 | } |
149 | 153 | } |
150 | | - } |
| 154 | + }, |
| 155 | + "examples": [ |
| 156 | + [ |
| 157 | + { |
| 158 | + "patterns": ["temp/", "*.tmp"], |
| 159 | + "min": 512, |
| 160 | + "max": 5242880 |
| 161 | + } |
| 162 | + ] |
| 163 | + ] |
151 | 164 | } |
152 | 165 | } |
153 | 166 | } |
|
177 | 190 | }, |
178 | 191 | "ignore_cert_errors": { |
179 | 192 | "type": "boolean", |
180 | | - "description": "Whether to ignore certificate errors" |
| 193 | + "description": "Whether to ignore TLS/SSL certificate errors. Intended for testing and development environments only; do not enable in production." |
181 | 194 | } |
182 | 195 | } |
183 | 196 | }, |
|
188 | 201 | }, |
189 | 202 | "ranking_threshold": { |
190 | 203 | "type": ["integer", "null"], |
191 | | - "description": "Ranking threshold value. A value of -1 defers to server configuration", |
| 204 | + "description": "Ranking threshold for file snippet results (range 0\u201310). A value of `-1` defers to server configuration. Higher values require stronger matches.", |
192 | 205 | "minimum": -1, |
193 | 206 | "maximum": 10, |
194 | 207 | "default": 0 |
|
207 | 220 | }, |
208 | 221 | "honour_file_exts": { |
209 | 222 | "type": ["boolean", "null"], |
210 | | - "description": "Ignores file extensions. When not set, defers to server configuration.", |
| 223 | + "description": "When `true`, the server considers file extensions during matching (e.g. a `.c` file only matches other `.c` files). When `false`, file extensions are ignored. When `null`, defers to server configuration.", |
211 | 224 | "default": true |
212 | 225 | }, |
213 | 226 | "dependency_analysis": { |
|
216 | 229 | }, |
217 | 230 | "skip_headers": { |
218 | 231 | "type": "boolean", |
219 | | - "description": "Skip license headers, comments and imports at the beginning of files", |
| 232 | + "description": "Skip license headers, comments, and imports at the beginning of files before snippet matching. Works together with `skip_headers_limit` to control how many leading lines are stripped.", |
220 | 233 | "default": false |
221 | 234 | }, |
222 | 235 | "skip_headers_limit": { |
223 | 236 | "type": "integer", |
224 | | - "description": "Maximum number of lines to skip when filtering headers", |
| 237 | + "description": "Maximum number of leading lines to strip when `skip_headers` is enabled. A value of `0` means no limit (strip all detected header lines).", |
225 | 238 | "default": 0 |
226 | 239 | } |
227 | 240 | } |
228 | 241 | }, |
229 | 242 | "hpfm": { |
230 | 243 | "type": "object", |
231 | | - "description": "HPFM (High Precision Folder Matching) configuration", |
| 244 | + "description": "HPFM (High Precision Folder Matching) configuration. HPFM detects copied directory structures by comparing folder-level fingerprints.", |
232 | 245 | "properties": { |
233 | 246 | "ranking_enabled": { |
234 | 247 | "type": "boolean", |
235 | | - "description": "Enable ranking for HPFM" |
| 248 | + "description": "Enable ranking for HPFM results" |
236 | 249 | }, |
237 | 250 | "ranking_threshold": { |
238 | 251 | "type": ["integer", "null"], |
239 | | - "description": "Ranking threshold value. A value of -1 defers to server configuration", |
| 252 | + "description": "Ranking threshold for HPFM results (range 0\u201399). Note: this range differs from `file_snippet.ranking_threshold` (0\u201310). A value of `-1` defers to server configuration. Higher values require stronger matches.", |
240 | 253 | "minimum": -1, |
241 | 254 | "maximum": 99, |
242 | 255 | "default": 0 |
|
255 | 268 | "properties": { |
256 | 269 | "include": { |
257 | 270 | "type": "array", |
258 | | - "description": "Set of rules to be added as context when scanning. This list will be sent as payload to the API.", |
| 271 | + "description": "Rules for adding components as scan context. Sent to the SCANOSS API to influence result matching. Requires purl; path is optional for partial matching.", |
259 | 272 | "items": { |
260 | 273 | "type": "object", |
261 | 274 | "properties": { |
262 | 275 | "path": { |
263 | 276 | "type": "string", |
264 | | - "description": "File or folder path. Paths ending with '/' are treated as folder rules and match all files under that directory.", |
| 277 | + "description": "File or folder path, relative to the scan root. Paths ending with `/` are treated as folder rules and match all files under that directory.", |
265 | 278 | "examples": ["src/main.c", "src/vendor/"] |
266 | 279 | }, |
267 | 280 | "purl": { |
268 | 281 | "type": "string", |
269 | | - "description": "Package URL to be used to match the component", |
| 282 | + "description": "Package URL identifying the component. Format: `pkg:<type>/<namespace>/<name>@<version>`. Version is recommended but optional.", |
270 | 283 | "examples": [ |
271 | 284 | "pkg:npm/vue@2.6.12", |
272 | 285 | "pkg:golang/github.com/golang/go@1.17.3" |
|
279 | 292 | }, |
280 | 293 | "uniqueItems": true, |
281 | 294 | "required": ["purl"] |
282 | | - } |
| 295 | + }, |
| 296 | + "examples": [ |
| 297 | + [ |
| 298 | + { |
| 299 | + "path": "src/lib/component.js", |
| 300 | + "purl": "pkg:npm/lodash@4.17.21", |
| 301 | + "comment": "Full match: path + purl" |
| 302 | + }, |
| 303 | + { |
| 304 | + "purl": "pkg:npm/vue@2.6.12", |
| 305 | + "comment": "Partial match: purl only" |
| 306 | + } |
| 307 | + ] |
| 308 | + ] |
283 | 309 | }, |
284 | 310 | "remove": { |
285 | 311 | "type": "array", |
286 | | - "description": "Set of rules that will remove files from the results file after the scan is completed.", |
| 312 | + "description": "Rules for removing components from results after scanning (client-side post-processing). Supports full match (both path and purl) or partial match (path only or purl only).", |
287 | 313 | "items": { |
288 | 314 | "type": "object", |
289 | 315 | "properties": { |
290 | 316 | "path": { |
291 | 317 | "type": "string", |
292 | | - "description": "File or folder path. Paths ending with '/' are treated as folder rules and match all files under that directory.", |
| 318 | + "description": "File or folder path, relative to the scan root. Paths ending with `/` are treated as folder rules and match all files under that directory.", |
293 | 319 | "examples": ["src/main.c", "src/vendor/"] |
294 | 320 | }, |
295 | 321 | "purl": { |
296 | 322 | "type": "string", |
297 | | - "description": "Package URL", |
| 323 | + "description": "Package URL identifying the component to remove. Format: `pkg:<type>/<namespace>/<name>@<version>`. Version is recommended but optional.", |
298 | 324 | "examples": [ |
299 | 325 | "pkg:npm/vue@2.6.12", |
300 | 326 | "pkg:golang/github.com/golang/go@1.17.3" |
|
310 | 336 | {"required": ["path"]} |
311 | 337 | ], |
312 | 338 | "uniqueItems": true |
313 | | - } |
| 339 | + }, |
| 340 | + "examples": [ |
| 341 | + [ |
| 342 | + { |
| 343 | + "path": "src/main.c", |
| 344 | + "purl": "pkg:npm/vue@2.6.12", |
| 345 | + "comment": "Full match: removes only this purl at this path" |
| 346 | + }, |
| 347 | + { |
| 348 | + "purl": "pkg:npm/deprecated-pkg@1.0.0", |
| 349 | + "comment": "Partial match: removes this purl wherever it appears" |
| 350 | + }, |
| 351 | + { |
| 352 | + "path": "src/vendor/", |
| 353 | + "comment": "Partial match: removes all results under this folder" |
| 354 | + } |
| 355 | + ] |
| 356 | + ] |
314 | 357 | }, |
315 | 358 | "replace": { |
316 | 359 | "type": "array", |
317 | | - "description": "Set of rules that will replace components with the specified one after the scan is completed.", |
| 360 | + "description": "Rules for replacing components in results after scanning (client-side post-processing). Requires both purl (original component) and replace_with (replacement). Path is optional for scoping.", |
318 | 361 | "items": { |
319 | 362 | "type": "object", |
320 | 363 | "properties": { |
321 | 364 | "path": { |
322 | 365 | "type": "string", |
323 | | - "description": "File or folder path. Paths ending with '/' are treated as folder rules and match all files under that directory.", |
| 366 | + "description": "File or folder path, relative to the scan root. Paths ending with `/` are treated as folder rules and match all files under that directory.", |
324 | 367 | "examples": ["src/main.c", "src/vendor/"] |
325 | 368 | }, |
326 | 369 | "purl": { |
327 | 370 | "type": "string", |
328 | | - "description": "Package URL to replace", |
| 371 | + "description": "Package URL of the original component to replace. Format: `pkg:<type>/<namespace>/<name>@<version>`. Version is recommended but optional.", |
329 | 372 | "examples": [ |
330 | 373 | "pkg:npm/vue@2.6.12", |
331 | 374 | "pkg:golang/github.com/golang/go@1.17.3" |
|
337 | 380 | }, |
338 | 381 | "license": { |
339 | 382 | "type": "string", |
340 | | - "description": "License of the component. Should be a valid SPDX license expression", |
| 383 | + "description": "License of the replacement component. Should be a valid SPDX license expression (e.g. `MIT`, `Apache-2.0`, `GPL-3.0-only`).", |
341 | 384 | "examples": ["MIT", "Apache-2.0"] |
342 | 385 | }, |
343 | 386 | "replace_with": { |
344 | 387 | "type": "string", |
345 | | - "description": "Package URL to replace with", |
| 388 | + "description": "The replacement Package URL. Format: `pkg:<type>/<namespace>/<name>@<version>`.", |
346 | 389 | "examples": [ |
347 | | - "pkg:npm/vue@2.6.12", |
348 | | - "pkg:golang/github.com/golang/go@1.17.3" |
| 390 | + "pkg:npm/vue@2.6.14", |
| 391 | + "pkg:npm/new-lib@2.0.0" |
349 | 392 | ] |
350 | 393 | } |
351 | 394 | }, |
352 | 395 | "uniqueItems": true, |
353 | 396 | "required": ["purl", "replace_with"] |
354 | | - } |
| 397 | + }, |
| 398 | + "examples": [ |
| 399 | + [ |
| 400 | + { |
| 401 | + "path": "src/utils/helper.js", |
| 402 | + "purl": "pkg:npm/old-lib@1.0.0", |
| 403 | + "replace_with": "pkg:npm/new-lib@2.0.0", |
| 404 | + "license": "MIT", |
| 405 | + "comment": "Upgrade to newer version" |
| 406 | + } |
| 407 | + ] |
| 408 | + ] |
355 | 409 | } |
356 | 410 | } |
357 | 411 | } |
|
0 commit comments