]> git.proxmox.com Git - pve-common.git/commit
allow Regexp objects for strings in the schema
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 14 Jul 2016 07:21:24 +0000 (09:21 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 14 Jul 2016 08:28:57 +0000 (10:28 +0200)
commit88a490ff71d5491b2564f4f49931e71410bed9c3
treeed91270d47df30bd31188ada9f78a408657a1f5f
parent123921731abd556c038c746973fee1a1c87b6920
allow Regexp objects for strings in the schema

The 'pattern' property has type string and format regex, so
it makes sense to allow Regexp objects to be used for it.

While check_type() doesn't know the format, Regexp objects
can be treated like strings anyway, including compared via
'eq' or matched via '=~', so we allow strings to generally
come from a Regexp object.
src/PVE/JSONSchema.pm