def validateType()

in api/plugins/openapi.py [0:0]


    def validateType(self, field, value, ftype):
        """ Validate a single field value against an expected type """

        # Get type of value, convert to JSON name of type.
        pyType = type(value).__name__
        jsonType = py2JSON[pyType] if pyType in py2JSON else pyType

        # Check if type matches
        if ftype != jsonType:
            raise OpenAPIException("OpenAPI mismatch: Field '%s' was expected to be %s, but was really %s!" % (field, ftype, jsonType))