Browse Source

🐛 Fix OpenAPI model fields int validations, change `gte` to `ge` (#9635)

🐛 Fix OpenAPI model fields int validations, change `gte` to `ge`
pull/9640/head
Sebastián Ramírez 2 years ago
committed by GitHub
parent
commit
2d35651a5a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      fastapi/openapi/models.py

12
fastapi/openapi/models.py

@ -108,14 +108,14 @@ class Schema(BaseModel):
exclusiveMaximum: Optional[float] = None exclusiveMaximum: Optional[float] = None
minimum: Optional[float] = None minimum: Optional[float] = None
exclusiveMinimum: Optional[float] = None exclusiveMinimum: Optional[float] = None
maxLength: Optional[int] = Field(default=None, gte=0) maxLength: Optional[int] = Field(default=None, ge=0)
minLength: Optional[int] = Field(default=None, gte=0) minLength: Optional[int] = Field(default=None, ge=0)
pattern: Optional[str] = None pattern: Optional[str] = None
maxItems: Optional[int] = Field(default=None, gte=0) maxItems: Optional[int] = Field(default=None, ge=0)
minItems: Optional[int] = Field(default=None, gte=0) minItems: Optional[int] = Field(default=None, ge=0)
uniqueItems: Optional[bool] = None uniqueItems: Optional[bool] = None
maxProperties: Optional[int] = Field(default=None, gte=0) maxProperties: Optional[int] = Field(default=None, ge=0)
minProperties: Optional[int] = Field(default=None, gte=0) minProperties: Optional[int] = Field(default=None, ge=0)
required: Optional[List[str]] = None required: Optional[List[str]] = None
enum: Optional[List[Any]] = None enum: Optional[List[Any]] = None
type: Optional[str] = None type: Optional[str] = None

Loading…
Cancel
Save