pydantic-json-patch 0.6.4__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic_json_patch
3
- Version: 0.6.4
3
+ Version: 2.0.0
4
4
  Summary: Pydantic models for implementing JSON Patch.
5
5
  Author: Jonathan Sharpe
6
6
  Author-email: Jonathan Sharpe <mail@jonrshar.pe>
7
7
  License-Expression: ISC
8
- Classifier: Development Status :: 4 - Beta
8
+ Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Framework :: FastAPI
10
10
  Classifier: Framework :: Pydantic
11
11
  Classifier: Framework :: Pydantic :: 2
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pydantic_json_patch"
3
- version = "0.6.4"
3
+ version = "2.0.0"
4
4
  description = "Pydantic models for implementing JSON Patch."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -13,7 +13,7 @@ dependencies = [
13
13
  ]
14
14
  license = "ISC"
15
15
  classifiers = [
16
- "Development Status :: 4 - Beta",
16
+ "Development Status :: 5 - Production/Stable",
17
17
  "Framework :: FastAPI",
18
18
  "Framework :: Pydantic",
19
19
  "Framework :: Pydantic :: 2",
@@ -36,10 +36,11 @@ class _BaseOp(BaseModel):
36
36
  model_config = ConfigDict(
37
37
  frozen=True,
38
38
  model_title_generator=_generate_title,
39
+ strict=True,
39
40
  )
40
41
 
41
42
  @classmethod
42
- def create(cls, *, path: str | Sequence[str], **kwargs: tp.Any) -> tx.Self: # noqa: ANN401
43
+ def create(cls, /, *, path: str | Sequence[str], **kwargs: tp.Any) -> tx.Self: # noqa: ANN401
43
44
  """Return an instance of the appropriate operation."""
44
45
  (op,) = tp.get_args(cls.model_fields["op"].annotation)
45
46
  return cls(op=op, path=cls._dump_pointer(path), **kwargs)
@@ -81,6 +82,7 @@ class _FromOp(_BaseOp):
81
82
  @classmethod
82
83
  def create(
83
84
  cls,
85
+ /,
84
86
  *,
85
87
  path: str | Sequence[str],
86
88
  from_: str | Sequence[str],
@@ -121,7 +123,7 @@ class _ValueOp(_BaseOp, tp.Generic[T]):
121
123
  return alias
122
124
 
123
125
  @classmethod
124
- def create(cls, *, path: str | Sequence[str], value: T) -> tx.Self: # ty: ignore[invalid-method-override] -- deliberately narrows **kwargs to named params
126
+ def create(cls, /, *, path: str | Sequence[str], value: T) -> tx.Self: # ty: ignore[invalid-method-override] -- deliberately narrows **kwargs to named params
125
127
  """Return an instance of the appropriate operation."""
126
128
  return super().create(path=path, value=value)
127
129
 
@@ -172,7 +174,7 @@ class RemoveOp(_BaseOp):
172
174
  """
173
175
 
174
176
  @classmethod
175
- def create(cls, *, path: str | Sequence[str]) -> tx.Self: # ty: ignore[invalid-method-override] -- deliberately narrows **kwargs to named params
177
+ def create(cls, /, *, path: str | Sequence[str]) -> tx.Self: # ty: ignore[invalid-method-override] -- deliberately narrows **kwargs to named params
176
178
  """Return an instance of the appropriate operation."""
177
179
  return super().create(path=path)
178
180