fix(mm): make type and format required in openapi schema for model config

This commit is contained in:
psychedelicious 2024-03-05 12:44:38 +11:00
parent 58fa9c2fac
commit 3030a34b88

View File

@ -164,7 +164,7 @@ class ModelConfigBase(BaseModel):
@staticmethod
def json_schema_extra(schema: dict[str, Any], model_class: Type[BaseModel]) -> None:
schema["required"].extend(["key"])
schema["required"].extend(["key", "type", "format"])
model_config = ConfigDict(validate_assignment=True, json_schema_extra=json_schema_extra)