fix: added strict validation to all ingress ints

This commit is contained in:
ITQ
2025-01-24 18:09:37 +03:00
parent ead34fd867
commit fe2bc038a9
3 changed files with 15 additions and 16 deletions
+3 -2
View File
@@ -2,16 +2,17 @@ import uuid
from typing import ClassVar
from ninja import ModelSchema, Schema
from pydantic import Field
from pydantic import Field, StrictInt
from apps.user.models import User
class UserTarget(ModelSchema):
age: StrictInt
class Meta:
model = User
fields: ClassVar[list[str]] = [
User.age.field.name,
User.country.field.name,
]