Skip to content

Commit a90ed1c

Browse files
[pre-commit.ci] pre-commit autoupdate (#964)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.4](astral-sh/ruff-pre-commit@v0.8.6...v0.9.4) - [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.1](python-jsonschema/check-jsonschema@0.30.0...0.31.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8b42152 commit a90ed1c

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ ci:
22
autoupdate_schedule: monthly
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.8.6
5+
rev: v0.9.4
66
hooks:
77
- id: ruff
88
- id: ruff-format
99
- repo: https://github.com/python-jsonschema/check-jsonschema
10-
rev: 0.30.0
10+
rev: 0.31.1
1111
hooks:
1212
- id: check-github-workflows
1313
- id: check-readthedocs

src/apispec/ext/marshmallow/openapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def schema2parameters(
167167
param["description"] = description
168168
return [param]
169169

170-
assert not getattr(
171-
schema, "many", False
172-
), "Schemas with many=True are only supported for 'json' location (aka 'in: body')"
170+
assert not getattr(schema, "many", False), (
171+
"Schemas with many=True are only supported for 'json' location (aka 'in: body')"
172+
)
173173

174174
fields = get_fields(schema, exclude_dump_only=True)
175175

src/apispec/ext/marshmallow/schema_resolver.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ class UserSchema(Schema):
136136
"in": "query",
137137
"name": "pet",
138138
"content": {
139-
"application/json": {"schema": {"$ref": "#/components/schemas/Pet"}}
139+
"application/json": {
140+
"schema": {"$ref": "#/components/schemas/Pet"}
141+
}
140142
},
141143
}
142144
]
@@ -209,7 +211,9 @@ def resolve_schema(self, data):
209211
{
210212
"description": "user to add to the system",
211213
"content": {
212-
"application/json": {"schema": {"$ref": "#/components/schemas/User"}}
214+
"application/json": {
215+
"schema": {"$ref": "#/components/schemas/User"}
216+
}
213217
},
214218
}
215219
@@ -261,7 +265,10 @@ def resolve_schema_dict(self, schema):
261265
{"type": "array", "items": {"$ref": "#/components/schemas/Pet"}}
262266
263267
# Input
264-
{"type": "object", "properties": {"pet": "PetSchcema", "user": "UserSchema"}}
268+
{
269+
"type": "object",
270+
"properties": {"pet": "PetSchcema", "user": "UserSchema"},
271+
}
265272
266273
# Output
267274
{

0 commit comments

Comments
 (0)