MatrixSynapse/changelog.d
David Robertson 74e4419eb4
Fix another jsonschema typecheck error (#11830)
Similar to #11817.

In `_create_power_level_validator` we
- retrieve `validator`. This is a class implementing the
  `jsonschema.protocols.Validator` interface. In other words,
  `validator: Type[jsonschema.protocols.Validator]`.
- we then create an second validator class by modifying the original
  `validator`. We return that class, which is also of type
  `Type[jsonschema.protocols.Validator]`.

So the original annotation was incorrect: it claimed we were returning
an instance of jsonSchema.Draft7Validator, not the class (or a subclass)
itself. (Strictly speaking this is incorrect, because `POWER_LEVELS_SCHEMA`
isn't pinned to a particular version of JSON Schema. But there are other
complications with the type stubs if you try to fix this; I felt like
the change herein was a decent compromise that better expresses intent).

(I suspect/hope the typeshed project would welcome an effort to improve
the jsonschema stubs. Let's see if I get some spare time.)
2022-01-25 15:29:28 -05:00
..
.gitignore
11612.bugfix
11621.feature
11639.feature
11658.feature Add admin API to get a list of federated rooms (#11658) 2022-01-25 16:11:40 +00:00
11683.removal
11767.bugfix
11784.bugfix
11788.feature
11789.feature
11792.misc
11793.misc
11794.misc
11795.misc
11799.misc
11810.misc
11811.misc CI: run Complement on the VM, not inside Docker (#11811) 2022-01-25 15:05:22 +00:00
11813.misc
11816.misc Check that `gc` method is available before using in `synapse/app/_base` (#11816) 2022-01-25 10:35:18 -08:00
11817.misc Fix another jsonschema typecheck error (#11830) 2022-01-25 15:29:28 -05:00
11821.doc
11823.misc
11830.misc Fix another jsonschema typecheck error (#11830) 2022-01-25 15:29:28 -05:00