MCPcopy
hub / github.com/pydantic/pydantic / Obj

Class Obj

tests/test_json.py:245–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243 """
244
245 class Obj(BaseModel):
246 id: condecimal(gt=0, max_digits=22, decimal_places=0)
247 price: Decimal = Decimal('0.01')
248
249 json_data = '{"id":"1","price":"0.01"}'
250 assert Obj(id=1).model_dump_json() == json_data

Callers 1

test_con_decimal_encodeFunction · 0.70

Calls 1

condecimalFunction · 0.90

Tested by 1

test_con_decimal_encodeFunction · 0.56