Skip to content

Commit

Permalink
NAS-134197 / 25.10 / Set extra="ignore" for CoreSetOptionsOptions (#1…
Browse files Browse the repository at this point in the history
…5695)

* Set extra="ignore" for CoreSetOptionsOptions

* Apply extra="ignore" for CoreSetOptionsOptions to v25_10_0
  • Loading branch information
bmeagherix authored Feb 13, 2025
1 parent 91d45fe commit e1dc846
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/middlewared/middlewared/api/v25_04_0/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CoreSetOptionsOptions(BaseModel, metaclass=ForUpdateMetaclass):
strict=True,
str_max_length=1024,
use_attribute_docstrings=True,
extra="ignore",
)

private_methods: bool
Expand Down
10 changes: 10 additions & 0 deletions src/middlewared/middlewared/api/v25_10_0/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Literal

from pydantic import ConfigDict

from middlewared.api.base import BaseModel, ForUpdateMetaclass, single_argument_result

__all__ = [
Expand All @@ -23,6 +25,14 @@ class CorePingResult(BaseModel):


class CoreSetOptionsOptions(BaseModel, metaclass=ForUpdateMetaclass):
# We can't use `extra="forbid"` here because newer version clients might try to set more options than we support
model_config = ConfigDict(
strict=True,
str_max_length=1024,
use_attribute_docstrings=True,
extra="ignore",
)

private_methods: bool
py_exceptions: bool

Expand Down

0 comments on commit e1dc846

Please sign in to comment.