I'm having an issue where incoming validation of a complex type with a nested user type (IPv4Address) is failing validation when it is a correct ipv4 address. I am using using WSME 0.6.1 and python 2.7.6.
Complex Types:
class VIP(wtypes.Base):
ip_address = wtypes.wsattr(wtypes.IPv4AddressType)
class LoadBalancer(wtypes.Base):
vip = wtypes.wsattr(VIP, mandatory=True)
Controllers:
@pecan.wsexpose(v1types.LoadBalancer, body=v1types.LoadBalancer)
def post(self, load_balancer):
return load_balancer
When doing a POST to the correct resource with this body:
{"vip": {"ip_address": "10.0.0.1"}}
I am getting this error:
{
debuginfo: null
faultcode: "Server"
faultstring: "Value should be IPv4 format"
}
it looks like in the fromjson method when it starts validating the actual ip "10.0.0.1" it is sending an instantiation of the IPv4AddressType instead of the actual ip address "10.0.0.1" to wsme.types.validate_value. Am I doing something wrong or is this a bug? The stack trace did not yield anymore information, unless you want the actual methods called. I can provide that if needed.
Thanks,
Brandon