I have events represented like this:
event = {
"properties": {
"http.requestMethod": "POST",
"http.userAgent": "wget",
"device.product": "ASA",
"device.vendor": "Cisco"
}
}
I would like to represent and validate these events using pydantic, but I am required to split all of the different namespaces into their own classes like this:
from pydantic import BaseModel, Field
class Http(BaseModel):
http_requestmethod = Field(alias="http.requestMethod")
http_useragent = Field(alias="http.userAgent")
class Device(BaseModel):
device_product = Field(alias="device.product")
device_vendor = Field(alias="device.vendor")
Does anyone know how I can achieve this?