]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
:bug: Allow Any type for enums in OpenAPI (#906)
author李冬冬 <lsongzhi@163.com>
Tue, 4 Feb 2020 03:37:47 +0000 (11:37 +0800)
committerGitHub <noreply@github.com>
Tue, 4 Feb 2020 03:37:47 +0000 (04:37 +0100)
fastapi/openapi/models.py

index 78b9d86aeee52a1b2ffb3573c4186f75ef89ec02..4ca963dfc11cbbed5772e6b34ff13a64cf9d1ff0 100644 (file)
@@ -101,7 +101,7 @@ class SchemaBase(BaseModel):
     maxProperties: Optional[int] = Field(None, gte=0)
     minProperties: Optional[int] = Field(None, gte=0)
     required: Optional[List[str]] = None
-    enum: Optional[List[str]] = None
+    enum: Optional[List[Any]] = None
     type: Optional[str] = None
     allOf: Optional[List[Any]] = None
     oneOf: Optional[List[Any]] = None