diff --git a/synapse/rest/client/models.py b/synapse/rest/client/models.py index 04c7723b0df4..dcdf01fdf67c 100644 --- a/synapse/rest/client/models.py +++ b/synapse/rest/client/models.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import TYPE_CHECKING, Dict, Optional, Type +from typing import TYPE_CHECKING, Dict, Optional from pydantic import Extra, StrictInt, StrictStr, constr, validator diff --git a/synapse/types.py b/synapse/types.py index 8542a0dbfcb9..0a32825c72f4 100644 --- a/synapse/types.py +++ b/synapse/types.py @@ -934,6 +934,7 @@ class SynapseBaseModel(BaseModel): Subclassing in this way is recommended by https://pydantic-docs.helpmanual.io/usage/model_config/#change-behaviour-globally """ + class Config: # By default, ignore fields that we don't recognise. extra = Extra.ignore