from typing import Callable, Any, List


class Param:

    def __init__(self,
                 type: Callable[[str], Any],
                 location: (str, List[str]) = None,
                 optional: bool =False,
                 default: Any =None,
                 action: str = None,
                 append: bool = False,
                 description: str = None):

        self.type = type  # type or [type, type]
        self.location = location  # cookies, query, form, headers
        self.optional = optional  # true, false
        self.default = default  # if optional is true
        self.action = action  # rename
        self.append = append  # list or not
        self.description = description  # description

        # location iterable
        if not isinstance(self.location, list):
            self.location = [self.location]


class ParameterGroup:
    pass

@@ -718,16 +718,150 @@
 cription
+%0A        if self.optional and not self.default:%0A            raise ValueError(%22if you set param optional, then type its default value%22)
 %0A%0A      

raise error when the param is optional and its default value is empty