Skip to content

Commit ed03b4f

Browse files
Update how-to-write-a-parser.md (#12210)
* Update how-to-write-a-parser.md - it is 4 methods that have to be added not 3 (see the numbered list 1..4 ) - the location of the doc for a new parser is now in: `docs/content/en/connecting_your_tools/parsers/<file/api>/` * Update how-to-write-a-parser.md 2 - update the import page documentation * Update docs/content/en/open_source/contributing/how-to-write-a-parser.md --------- Co-authored-by: Cody Maffucci <46459665+Maffooch@users.noreply.github.com>
1 parent 423d98d commit ed03b4f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/content/en/open_source/contributing/how-to-write-a-parser.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ $ docker compose build --build-arg uid=1000
3737
|`unittests/scans/<parser_dir>/{many_vulns,no_vuln,one_vuln}.json` | Sample files containing meaningful data for unit tests. The minimal set.
3838
|`unittests/tools/test_<parser_name>_parser.py` | Unit tests of the parser.
3939
|`dojo/settings/settings.dist.py` | If you want to use a modern hashcode based deduplication algorithm
40-
|`doc/content/en/integrations/parsers/<file/api>/<parser_file>.md` | Documentation, what kind of file format is required and how it should be obtained
40+
|`docs/content/en/connecting_your_tools/parsers/<file/api>/<parser_file>.md` | Documentation, what kind of file format is required and how it should be obtained
41+
4142

4243
## Factory contract
4344

@@ -50,7 +51,7 @@ Parsers are loaded dynamicaly with a factory pattern. To have your parser loaded
5051
3. The name of this class **MUST** be the Python module name without underscores and with `Parser` suffix.
5152
- ex: `dojo.tools.my_tool.parser.MyToolParser`
5253
4. This class **MUST** have an empty constructor or no constructor
53-
5. This class **MUST** implement 3 methods:
54+
5. This class **MUST** implement 4 methods:
5455
1. `def get_scan_types(self)` This function return a list of all the *scan_type* supported by your parser. This identifiers are used internally. Your parser can support more than one *scan_type*. For example some parsers use different identifier to modify the behavior of the parser (aggregate, filter, etc...)
5556
2. `def get_label_for_scan_types(self, scan_type):` This function return a string used to provide some text in the UI (short label)
5657
3. `def get_description_for_scan_types(self, scan_type):` This function return a string used to provide some text in the UI (long description)
@@ -357,7 +358,7 @@ If you want to take a look at previous parsers that are now part of DefectDojo,
357358

358359
## Update the import page documentation
359360

360-
Please add a new .md file in [`docs/content/en/integrations/parsers`] with the details of your new parser. Include the following content headings:
361+
Please add a new .md file in [`docs/content/en/connecting_your_tools/parsers`] with the details of your new parser. Include the following content headings:
361362

362363
* Acceptable File Type(s) - please include how to generate this type of file from the related tool, as some tools have multiple methods or require specific commands.
363364
* An example unit test block, if applicable.

0 commit comments

Comments
 (0)