Skip to content

Commit

Permalink
Remove model field example kwargs (#77)
Browse files Browse the repository at this point in the history
* Don't reinstantiate client unless needed

* Remove outdated comment

* Remove outdated Pydantic `example` Field kwargs
  • Loading branch information
pederhan authored Mar 1, 2024
1 parent def9431 commit 50b9ef1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ While the project is still on major version 0, breaking changes may be introduce

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

### Removed

- Model field `example` keyword arguments.

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

Expand Down
1 change: 0 additions & 1 deletion codegen/ast/fragments/scanner/vulnerabilityitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class VulnerabilityItem(BaseModel):
links: Optional[List[str]] = Field(
None,
description="The list of links to the upstream databases with the full description of the vulnerability.\n",
example=["https://security-tracker.debian.org/tracker/CVE-2017-8283"],
)

@field_validator("severity", mode="before")
Expand Down
3 changes: 0 additions & 3 deletions codegen/ast/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ def construct_field(self) -> ast.AnnAssign:
ctx=ast.Load(),
),
description="The severity of the vulnerability.",
example=ast.keyword(
arg="example", value=ast.Name(id="Severity.high.value")
),
),
],
},
Expand Down
5 changes: 1 addition & 4 deletions harborapi/models/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ class VulnerabilityItem(BaseModel):
examples=["1.18.0"],
)
severity: Severity = Field(
Severity.unknown,
description="The severity of the vulnerability.",
example=Severity.high.value,
Severity.unknown, description="The severity of the vulnerability."
)
description: Optional[str] = Field(
None,
Expand All @@ -257,7 +255,6 @@ class VulnerabilityItem(BaseModel):
links: Optional[List[str]] = Field(
None,
description="The list of links to the upstream databases with the full description of the vulnerability.\n",
example=["https://security-tracker.debian.org/tracker/CVE-2017-8283"],
)
preferred_cvss: Optional[CVSSDetails] = None
cwe_ids: Optional[List[str]] = Field(
Expand Down

0 comments on commit 50b9ef1

Please sign in to comment.