2022-09-21 22:31:50 +02:00
|
|
|
from pydantic import *
|
|
|
|
|
|
|
|
class Model(BaseModel):
|
|
|
|
test: str = "test"
|
|
|
|
i: int
|
|
|
|
|
|
|
|
|
|
|
|
d = {'title': 'Sendtest', 'type': 'object', 'properties': {'i': {
|
|
|
|
'title': 'I', 'type': 'integer'}}, 'required': ['i'], 'additionalProperties': False}
|
|
|
|
|
|
|
|
props = {(k) for k,v in d['properties']}
|
|
|
|
|
|
|
|
obj = create_model("model", foo=(str, "str"))
|
|
|
|
print(Model(i=12, l=12))
|