Skip to content

Commit 139d792

Browse files
authored
Merge pull request #36 from mike-oakley/u/mike/maintenance
chore: Update dependencies to resolve security advisories.
2 parents 3623532 + 1783927 commit 139d792

File tree

8 files changed

+412
-460
lines changed

8 files changed

+412
-460
lines changed

openapi_pydantic/v3/v3_0_3/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,7 @@ def schema_validate(
605605
strict: Optional[bool] = None,
606606
from_attributes: Optional[bool] = None,
607607
context: Optional[Dict[str, Any]] = None
608-
) -> Schema:
609-
...
608+
) -> Schema: ...
610609

611610
elif PYDANTIC_V2:
612611
schema_validate = Schema.model_validate

openapi_pydantic/v3/v3_0_3/util.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ def get_mode(
5858

5959
if TYPE_CHECKING:
6060

61-
class GenerateOpenAPI30Schema:
62-
...
61+
class GenerateOpenAPI30Schema: ...
6362

6463
elif PYDANTIC_V2:
6564
from enum import Enum
@@ -111,8 +110,7 @@ def literal_schema(self, schema: core_schema.LiteralSchema) -> JsonSchemaValue:
111110

112111
else:
113112

114-
class GenerateOpenAPI30Schema:
115-
...
113+
class GenerateOpenAPI30Schema: ...
116114

117115

118116
def construct_open_api_with_schema_class(

openapi_pydantic/v3/v3_1_0/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,7 @@ def schema_validate(
962962
strict: Optional[bool] = None,
963963
from_attributes: Optional[bool] = None,
964964
context: Optional[Dict[str, Any]] = None
965-
) -> Schema:
966-
...
965+
) -> Schema: ...
967966

968967
elif PYDANTIC_V2:
969968
schema_validate = Schema.model_validate

poetry.lock

Lines changed: 395 additions & 436 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "openapi-pydantic"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
description = "Pydantic OpenAPI schema implementation"
55
authors = ["Mike Oakley <[email protected]>"]
66
readme = "README.md"
@@ -26,15 +26,15 @@ python = "^3.8"
2626
pydantic = ">=1.8"
2727

2828
[tool.poetry.group.test.dependencies]
29-
pytest = "^7.3.0"
30-
pytest-cov = "^4.0.0"
29+
pytest = "^8.2.2"
30+
pytest-cov = "^5.0.0"
3131
openapi-spec-validator = "^0.7.0"
3232

3333
[tool.poetry.group.dev.dependencies]
34-
black = "^23.12.1"
34+
black = "^24.4.2"
3535
mypy = "^1.8.0"
3636
pre-commit = "^2.16.0"
37-
ruff = "^0.1.9"
37+
ruff = "^0.4.8"
3838

3939
[build-system]
4040
requires = ["poetry-core>=1.0.0"]

tests/util/test_optional_and_computed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def construct_sample_api() -> OpenAPI:
6363

6464
if TYPE_CHECKING:
6565

66-
def computed_field(x: Callable) -> Callable:
67-
...
66+
def computed_field(x: Callable) -> Callable: ...
6867

6968
else:
7069
from pydantic import computed_field

tests/util/test_pydantic_field.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Union
1+
from typing import Union
22

33
from pydantic import BaseModel, Field
44
from typing_extensions import Literal
@@ -59,17 +59,16 @@ def construct_base_open_api() -> OpenAPI:
5959
def test_pydantic_discriminator_schema_generation() -> None:
6060
"""https://github.com/kuimono/openapi-schema-pydantic/issues/8"""
6161

62-
a_kind: Dict[str, Any]
63-
b_kind: Dict[str, Any]
62+
a_kind = {"const": "a", "enum": ["a"], "title": "Kind", "type": "string"}
63+
b_kind = {"const": "b", "enum": ["b"], "title": "Kind", "type": "string"}
6464

6565
if PYDANTIC_V2:
6666
_key_map, json_schema = models_json_schema([(RequestModel, "validation")])
67-
a_kind = {"const": "a", "title": "Kind"}
68-
b_kind = {"const": "b", "title": "Kind"}
6967
else:
7068
json_schema = v1_schema([RequestModel])
71-
a_kind = {"enum": ["a"], "title": "Kind", "type": "string"}
72-
b_kind = {"enum": ["b"], "title": "Kind", "type": "string"}
69+
a_kind.pop("const")
70+
b_kind.pop("const")
71+
7372
assert json_schema == {
7473
DEFS_KEY: {
7574
"DataAModel": {

tests/v3_0_3/test_optional_and_computed.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ def construct_sample_api() -> OpenAPI:
6666

6767
if TYPE_CHECKING:
6868

69-
def computed_field(x: Callable) -> Callable:
70-
...
69+
def computed_field(x: Callable) -> Callable: ...
7170

7271
else:
7372
from pydantic import computed_field

0 commit comments

Comments
 (0)