Exemplo n.º 1
0
 def resolve(self,
             parameter: Parameter,
             query_params: http.QueryParams) -> http.QueryParam:
     name = parameter.name
     assert name in query_params or parameter.default != inspect._empty, \
         f"Query Param: {name} not found!"
     return http.QueryParam(query_params.get(name, parameter.default))
Exemplo n.º 2
0
 def resolve(
     self, parameter: Parameter, query_params: http.QueryParams
 ) -> http.QueryParam:
     name = parameter.name
     if name not in query_params:
         return None
     return http.QueryParam(query_params[name])
Exemplo n.º 3
0
    def resolve(
            self, parameter: Parameter, query_params: http.QueryParams
    ) -> typing.Optional[http.QueryParam]:

        name = parameter.name
        if name not in query_params:
            return None

        return http.QueryParam(query_params[name])