Skip to content

Commit 50b9ef1

Browse files
authored
Remove model field example kwargs (#77)
* Don't reinstantiate client unless needed * Remove outdated comment * Remove outdated Pydantic `example` Field kwargs
1 parent def9431 commit 50b9ef1

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ While the project is still on major version 0, breaking changes may be introduce
2020

2121
- `HarborAsyncClient.authenticate(verify=...)` will no longer instantiate a new client object if the `verify` value is identical to current one.
2222

23+
### Removed
24+
25+
- Model field `example` keyword arguments.
2326

2427
## [0.23.3](https://github.com/unioslo/harborapi/tree/harborapi-v0.23.3) - 2024-03-01
2528

codegen/ast/fragments/scanner/vulnerabilityitem.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class VulnerabilityItem(BaseModel):
1818
links: Optional[List[str]] = Field(
1919
None,
2020
description="The list of links to the upstream databases with the full description of the vulnerability.\n",
21-
example=["https://security-tracker.debian.org/tracker/CVE-2017-8283"],
2221
)
2322

2423
@field_validator("severity", mode="before")

codegen/ast/parser.py

-3
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ def construct_field(self) -> ast.AnnAssign:
195195
ctx=ast.Load(),
196196
),
197197
description="The severity of the vulnerability.",
198-
example=ast.keyword(
199-
arg="example", value=ast.Name(id="Severity.high.value")
200-
),
201198
),
202199
],
203200
},

harborapi/models/scanner.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ class VulnerabilityItem(BaseModel):
243243
examples=["1.18.0"],
244244
)
245245
severity: Severity = Field(
246-
Severity.unknown,
247-
description="The severity of the vulnerability.",
248-
example=Severity.high.value,
246+
Severity.unknown, description="The severity of the vulnerability."
249247
)
250248
description: Optional[str] = Field(
251249
None,
@@ -257,7 +255,6 @@ class VulnerabilityItem(BaseModel):
257255
links: Optional[List[str]] = Field(
258256
None,
259257
description="The list of links to the upstream databases with the full description of the vulnerability.\n",
260-
example=["https://security-tracker.debian.org/tracker/CVE-2017-8283"],
261258
)
262259
preferred_cvss: Optional[CVSSDetails] = None
263260
cwe_ids: Optional[List[str]] = Field(

0 commit comments

Comments
 (0)