json_encoder
json_encoder​
View sourcejson_encoder(
msg
)
Encoder to encode pydantic instances to json string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg | BaseModel | An instance of pydantic basemodel | required |
Returns:
Type | Description |
---|---|
bytes | Json string in bytes which is encoded from pydantic basemodel |