mirror of
https://github.com/PaiGramTeam/SIMNet.git
synced 2024-11-22 06:17:57 +00:00
✨ Add APIModel
This commit is contained in:
parent
90ee5725e0
commit
73410f136e
16
simnet/models/base.py
Normal file
16
simnet/models/base.py
Normal file
@ -0,0 +1,16 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
try:
|
||||
import ujson as jsonlib
|
||||
except ImportError:
|
||||
import json as jsonlib
|
||||
|
||||
|
||||
class APIModel(BaseModel):
|
||||
"""A Pydantic BaseModel class used for modeling JSON data returned by an API."""
|
||||
|
||||
class Config:
|
||||
"""A nested class defining configuration options for the APIModel."""
|
||||
|
||||
json_dumps = jsonlib.dumps
|
||||
json_loads = jsonlib.loads
|
Loading…
Reference in New Issue
Block a user