Skip to content

Irrelevant arguments may produce exceptions #3

@DDimitris

Description

@DDimitris

Because of dynamically created methods, the arguments passed by a user, are stored within a dictionary thus in case irrelevant arguments are passed, two scenarios may occur:

  1. The size of the dictionary increases thus various checks may fail
  2. These arguments are passed to methods that cannot handle them thus exceptions may occur

A possible solution to this problem may be the following:
Create a method within the FuckingOperations() class that fetch all the available fields that can be used, from the /operations json and store them within a HashSet. Afterwards, for every method call, all the arguments should be checked against that HashSet for existence. In case an argument doesn't exists, warn the user and exit the method without making an HTTP call to the framework.

An example of such a case could be the following:

>>>from foaas.foaas_client import Fuck
>>>f = Fuck()
>>>print(f.that(arg1_="an argument").text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions