Bump jsonschema stubs (#12912)

pull/12916/head
David Robertson 2022-05-30 10:47:09 +01:00 committed by GitHub
parent 6be4953b99
commit 796a0312e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

1
changelog.d/12912.misc Normal file
View File

@ -0,0 +1 @@
Bump types-jsonschema from 4.4.1 to 4.4.6.

6
poetry.lock generated
View File

@ -1355,7 +1355,7 @@ python-versions = "*"
[[package]] [[package]]
name = "types-jsonschema" name = "types-jsonschema"
version = "4.4.1" version = "4.4.6"
description = "Typing stubs for jsonschema" description = "Typing stubs for jsonschema"
category = "dev" category = "dev"
optional = false optional = false
@ -2618,8 +2618,8 @@ types-ipaddress = [
{file = "types_ipaddress-1.0.8-py3-none-any.whl", hash = "sha256:4933b74da157ba877b1a705d64f6fa7742745e9ffd65e51011f370c11ebedb55"}, {file = "types_ipaddress-1.0.8-py3-none-any.whl", hash = "sha256:4933b74da157ba877b1a705d64f6fa7742745e9ffd65e51011f370c11ebedb55"},
] ]
types-jsonschema = [ types-jsonschema = [
{file = "types-jsonschema-4.4.1.tar.gz", hash = "sha256:bd68b75217ebbb33b0242db10047581dad3b061a963a46ee80d4a9044080663e"}, {file = "types-jsonschema-4.4.6.tar.gz", hash = "sha256:7f2a804618756768c7c0616f8c794b61fcfe3077c7ee1ad47dcf01c5e5f692bb"},
{file = "types_jsonschema-4.4.1-py3-none-any.whl", hash = "sha256:ab3ecfdc912d6091cc82f4b7556cfbf1a7cbabc26da0ceaa1cbbc232d1d09971"}, {file = "types_jsonschema-4.4.6-py3-none-any.whl", hash = "sha256:1db9031ca49a8444d01bd2ce8cf2f89318382b04610953b108321e6f8fb03390"},
] ]
types-opentracing = [ types-opentracing = [
{file = "types-opentracing-2.4.7.tar.gz", hash = "sha256:be60e9618355aa892571ace002e6b353702538b1c0dc4fbc1c921219d6658830"}, {file = "types-opentracing-2.4.7.tar.gz", hash = "sha256:be60e9618355aa892571ace002e6b353702538b1c0dc4fbc1c921219d6658830"},

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import collections.abc import collections.abc
from typing import Iterable, Type, Union from typing import Iterable, Type, Union, cast
import jsonschema import jsonschema
@ -103,7 +103,12 @@ class EventValidator:
except jsonschema.ValidationError as e: except jsonschema.ValidationError as e:
if e.path: if e.path:
# example: "users_default": '0' is not of type 'integer' # example: "users_default": '0' is not of type 'integer'
message = '"' + e.path[-1] + '": ' + e.message # noqa: B306 # cast safety: path entries can be integers, if we fail to validate
# items in an array. However the POWER_LEVELS_SCHEMA doesn't expect
# to see any arrays.
message = (
'"' + cast(str, e.path[-1]) + '": ' + e.message # noqa: B306
)
# jsonschema.ValidationError.message is a valid attribute # jsonschema.ValidationError.message is a valid attribute
else: else:
# example: '0' is not of type 'integer' # example: '0' is not of type 'integer'