You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fields are still included when using repr=False. Look at the following example:
Expected behaviour is to have fields with repr=False to not serialize, or am I missing something? :)
from pydantic import BaseModel, Field
from ninja import Schema
class ModelExample(BaseModel):
height: int
width: int
area: int = Field(repr=False)
### or
@computed_field(repr=False)
@cached_property
def area(self) -> int:
return height*width
class OutSchema(ModelExample, Schema):
pass
Versions (please complete the following information):
Python version: 3.12
Django version: 5.01
Django-Ninja version: 1.2.x
Pydantic version: 2.x
The text was updated successfully, but these errors were encountered:
Fields are still included when using repr=False. Look at the following example:
Expected behaviour is to have fields with repr=False to not serialize, or am I missing something? :)
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: