Kaynağa Gözat

Bump jsonschema stubs (#12912)

tags/v1.61.0rc1
David Robertson 1 yıl önce
committed by GitHub
ebeveyn
işleme
796a0312e1
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
3 değiştirilmiş dosya ile 11 ekleme ve 5 silme
  1. +1
    -0
      changelog.d/12912.misc
  2. +3
    -3
      poetry.lock
  3. +7
    -2
      synapse/events/validator.py

+ 1
- 0
changelog.d/12912.misc Dosyayı Görüntüle

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

+ 3
- 3
poetry.lock Dosyayı Görüntüle

@@ -1355,7 +1355,7 @@ python-versions = "*"

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


+ 7
- 2
synapse/events/validator.py Dosyayı Görüntüle

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import collections.abc
from typing import Iterable, Type, Union
from typing import Iterable, Type, Union, cast

import jsonschema

@@ -103,7 +103,12 @@ class EventValidator:
except jsonschema.ValidationError as e:
if e.path:
# 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
else:
# example: '0' is not of type 'integer'


Yükleniyor…
İptal
Kaydet