flexiodata/flexio-web-app

DISCUSSION: Function test params

Opened this issue · 0 comments

We may want to add a way in the function test area to also specify function mount parameters. The test area is rightly focused on testing input parameters from the sheets, but it's also important to be able to develop and test with mount parameters, and right now, the only way to specify these is by defining the yaml mount interface outside the package, then refreshing the connection.

For example: if I'm developing a function pack that uses an api key, I want to add the code in the function that gets the api key from the function mount; it looks like this:

    # get the api key from the variable input
    auth_token = dict(flex.vars).get("service_api_key")
    if auth_token is None:
        flex.output.content_type = "application/json"
        flex.output.write([[""]])
        return

However, to test this, I need an easy way to specify the service-api variable, and the only way to do this is through the mount form or an api call outside flex.

I think it's important whatever is added to not interfere with the streamlined approach right now; this may be suited to the advanced area where we allow the user to specify config inputs as well as the normal function param inputs.