Open ingvaldlorentzen opened 2 years ago
This is still an issue in the new 0.3.0
version.
Hi @ingvaldlorentzen , right now we don't support custom validator in external plugins. You will need to do it on Python side (like in the __init__
function). I will also update the docs to reflect this.
Hi @ingvaldlorentzen , right now we don't support custom validator in external plugins. You will need to do it on Python side (like in the
__init__
function). I will also update the docs to reflect this.
Follow up question to this thread ... when adding plugin config validation code to the init function, what should be the behavior if a problem is found? The Python PDK documentation doesn't go into that detail ... does this function only run once when the plugin server starts or with every request? If the former, should the correct action be to throw an exception so the plugin server stops?
Hi,
I'm unable to get custom validators for the
Schema
working.The docs say:
So I would assume this would work:
But this produces the following error:
TypeError: Object of type function is not JSON serializable
If I make the value a string, e.g.
I get the following error:
custom_validator = "expected a function"
How can I do custom validation with the Python PDK? My use case is to encrypt a field before it is stored, since the Python PDK cannot access environment variables.
In general a more complete example showing how the Lua schema is used in the Python PDK would be great!