We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've implemented a Regex - primitive parametrized type that matches regular expression on the string.
Should this be included as a basic type? or some sort of plugin/extension?
import re from teleport import ValidationError, ParametrizedPrimitive, Schema class Regex(ParametrizedPrimitive): param_schema = Schema def from_json(self, datum): if re.match(self.param, datum) is None: raise ValidationError("Regex '%s' does not match " % self.param, datum) return datum def to_json(self, datum): return datum
Also, should I validate if datum is indeed a String?
datum
String
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've implemented a Regex - primitive parametrized type that matches regular expression on the string.
Should this be included as a basic type? or some sort of plugin/extension?
Also, should I validate if
datum
is indeed aString
?The text was updated successfully, but these errors were encountered: