json_decoder
json_decoder​
View sourcejson_decoder(
raw_msg, cls
)
Decoder to decode json string in bytes to pydantic model instance
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raw_msg | bytes | Bytes message received from Kafka topic | required |
cls | Type[pydantic.main.BaseModel] | Pydantic class; This pydantic class will be used to construct instance of same class | required |
Returns:
Type | Description |
---|---|
Any | An instance of given pydantic class |