Skip to main content
Version: dev 🚧

json_decoder

json_decoder​

View source
json_decoder(
raw_msg, cls
)

Decoder to decode json string in bytes to pydantic model instance

Parameters:

NameTypeDescriptionDefault
raw_msgbytesBytes message received from Kafka topicrequired
clsType[pydantic.main.BaseModel]Pydantic class; This pydantic class will be used to construct instance of same classrequired

Returns:

TypeDescription
AnyAn instance of given pydantic class