protected function getSwaggerType()
    {
        $type = $this->getType();
        switch ($type) {
            case null:
                return PropertyType::STRING;

            case PropertyType::INTEGER:
            case PropertyType::STRING:
            case PropertyType::NUMBER:
            case PropertyType::BOOL:
            case PropertyType::OBJECT:
                return $type;

            case PropertyType::DATETIME:
                return PropertyType::STRING;

            default:
                throw new \InvalidArgumentException("Type cannot be matched with a swagger type.");
        }
    }