Encode decimals as number in JSON
This commit is contained in:
parent
148275dd98
commit
b1a94c5359
6 changed files with 36 additions and 1 deletions
|
@ -8,6 +8,8 @@ from app.schemas.connector import Connector
|
|||
|
||||
from ocpp.v201.enums import ResetEnumType, ResetStatusEnumType
|
||||
|
||||
from app.util.encoders import decimal_encoder
|
||||
|
||||
class ChargePointBase(BaseModel):
|
||||
identity: str
|
||||
is_active: bool
|
||||
|
@ -32,6 +34,7 @@ class ChargePoint(ChargePointBase):
|
|||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
json_encoders = {Decimal: decimal_encoder}
|
||||
|
||||
class ChargePointPassword(BaseModel):
|
||||
password: str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue