mirror of
https://github.com/PaiGramTeam/SIMNet.git
synced 2024-11-16 20:10:37 +00:00
17 lines
394 B
Python
17 lines
394 B
Python
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
|