Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit 0b20c26

Browse files
authored
documentation (#53)
1 parent 5d91ffa commit 0b20c26

400 files changed

Lines changed: 56178 additions & 10 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openapi-generator-ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
#docs/*.md
2222
# Then explicitly reverse the ignore rule for a single file:
2323
#!docs/README.md
24-
*README.md
24+
README.md

.openapi-generator/FILES

Lines changed: 394 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,65 @@
1010

1111
Python library to interact with DefectDojo - generated from OpenAPI definition using https://openapi-generator.tech/
1212

13-
## Install
13+
Multiple changes done on top of default openapi-generator:
14+
* A friendlier Client class
15+
* Tweak validations to reduce package import time to about 1/3
16+
* Remove most of pydantic/schema validations due to inconsistencies with actual database schema/requirements (tracked in https://github.com/fopina/defectdojo-api-generated/issues/39)
17+
* A nice CLI exposing all the API methods <3
18+
* installed only as an extra, to keep everything clean when package is used as library only
19+
20+
## Example
21+
22+
### Library
1423

1524
```
1625
pip install defectojo-api-generated
1726
```
1827

19-
## Usage
20-
2128
```python
2229
from defectdojo_api_generated import DefectDojo
2330

2431
# password publicly available in https://github.com/DefectDojo/django-DefectDojo/?tab=readme-ov-file#demo
25-
# then get API token from https://demo.defectdojo.org/api/key-v2
26-
dojo = DefectDojo('https://demo.defectdojo.org/', token=...)
32+
dojo = DefectDojo('https://demo.defectdojo.org/', username='admin', password='...')
2733
r = dojo.findings_api.list()
2834
print(r.json())
2935
```
3036

31-
## Build
37+
#### **Full documentation** [in docs](docs/README.md)
38+
39+
### CLI
40+
41+
[![asciicast](https://asciinema.org/a/fIPDy8iYxGL85pXb.svg)](https://asciinema.org/a/fIPDy8iYxGL85pXb)
42+
43+
> [uv](https://docs.astral.sh/uv/) recommended or [pipx](https://github.com/pypa/pipx)
44+
45+
```
46+
uv tool install 'defectojo-api-generated[cli]'
47+
```
48+
49+
```
50+
$ dojo
51+
Usage: dojo [OPTIONS] COMMAND [ARGS]...
52+
53+
DefectDojo CLI
54+
55+
Options:
56+
...
57+
Commands:
58+
api Interact directly with any API/method
59+
config Show or edit the current CLI configuration
60+
status Quick connectivity check
61+
```
62+
63+
You can also skip tool install and just run it with:
64+
65+
```
66+
$ uvx 'defectojo-api-generated[cli]'
67+
Usage: dojo [OPTIONS] COMMAND [ARGS]...
68+
...
69+
```
70+
71+
## Contributing
3272

3373
Check out [CONTRIBUTING.md](CONTRIBUTING.md)
3474

docs/README.md

Lines changed: 898 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AcceptedRiskRequest
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**vulnerability_id** | **str** | An id of a vulnerability in a security advisory associated with this finding. Can be a Common Vulnerabilities and Exposure (CVE) or from other sources. | [optional]
9+
**justification** | **str** | Justification for accepting findings with this vulnerability id | [optional]
10+
**accepted_by** | **str** | Name or email of person who accepts the risk | [optional]
11+
12+
## Example
13+
14+
```python
15+
from defectdojo_api_generated.models.accepted_risk_request import AcceptedRiskRequest
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of AcceptedRiskRequest from a JSON string
20+
accepted_risk_request_instance = AcceptedRiskRequest.from_json(json)
21+
# print the JSON string representation of the object
22+
print(AcceptedRiskRequest.to_json())
23+
24+
# convert the object into a dict
25+
accepted_risk_request_dict = accepted_risk_request_instance.to_dict()
26+
# create an instance of AcceptedRiskRequest from a dict
27+
accepted_risk_request_from_dict = AcceptedRiskRequest.from_dict(accepted_risk_request_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AddNewNoteOptionRequest
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**entry** | **str** | | [optional]
9+
**private** | **bool** | | [optional]
10+
**note_type** | **int** | | [optional]
11+
12+
## Example
13+
14+
```python
15+
from defectdojo_api_generated.models.add_new_note_option_request import AddNewNoteOptionRequest
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of AddNewNoteOptionRequest from a JSON string
20+
add_new_note_option_request_instance = AddNewNoteOptionRequest.from_json(json)
21+
# print the JSON string representation of the object
22+
print(AddNewNoteOptionRequest.to_json())
23+
24+
# convert the object into a dict
25+
add_new_note_option_request_dict = add_new_note_option_request_instance.to_dict()
26+
# create an instance of AddNewNoteOptionRequest from a dict
27+
add_new_note_option_request_from_dict = AddNewNoteOptionRequest.from_dict(add_new_note_option_request_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+

docs/apimodels/Announcement.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Announcement
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**id** | **int** | | [optional] [readonly]
9+
**message** | **str** | This dismissable message will be displayed on all pages for authenticated users. It can contain basic html tags, for example &lt;a href&#x3D;&#39;https://www.fred.com&#39; style&#x3D;&#39;color: #337ab7;&#39; target&#x3D;&#39;_blank&#39;&gt;https://example.com&lt;/a&gt; | [optional]
10+
**style** | **str** | The style of banner to display. (info, success, warning, danger) * &#x60;info&#x60; - Info * &#x60;success&#x60; - Success * &#x60;warning&#x60; - Warning * &#x60;danger&#x60; - Danger | [optional]
11+
**dismissable** | **bool** | Ticking this box allows users to dismiss the current announcement | [optional]
12+
13+
## Example
14+
15+
```python
16+
from defectdojo_api_generated.models.announcement import Announcement
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of Announcement from a JSON string
21+
announcement_instance = Announcement.from_json(json)
22+
# print the JSON string representation of the object
23+
print(Announcement.to_json())
24+
25+
# convert the object into a dict
26+
announcement_dict = announcement_instance.to_dict()
27+
# create an instance of Announcement from a dict
28+
announcement_from_dict = Announcement.from_dict(announcement_dict)
29+
```
30+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
31+
32+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AnnouncementRequest
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**message** | **str** | This dismissable message will be displayed on all pages for authenticated users. It can contain basic html tags, for example &lt;a href&#x3D;&#39;https://www.fred.com&#39; style&#x3D;&#39;color: #337ab7;&#39; target&#x3D;&#39;_blank&#39;&gt;https://example.com&lt;/a&gt; | [optional]
9+
**style** | **str** | The style of banner to display. (info, success, warning, danger) * &#x60;info&#x60; - Info * &#x60;success&#x60; - Success * &#x60;warning&#x60; - Warning * &#x60;danger&#x60; - Danger | [optional]
10+
**dismissable** | **bool** | Ticking this box allows users to dismiss the current announcement | [optional]
11+
12+
## Example
13+
14+
```python
15+
from defectdojo_api_generated.models.announcement_request import AnnouncementRequest
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of AnnouncementRequest from a JSON string
20+
announcement_request_instance = AnnouncementRequest.from_json(json)
21+
# print the JSON string representation of the object
22+
print(AnnouncementRequest.to_json())
23+
24+
# convert the object into a dict
25+
announcement_request_dict = announcement_request_instance.to_dict()
26+
# create an instance of AnnouncementRequest from a dict
27+
announcement_request_from_dict = AnnouncementRequest.from_dict(announcement_request_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+

0 commit comments

Comments
 (0)