Would it be possible to persist test data in the API action (Define API Schema) section? I find myself having to enter multiple fields every time I make a change in the API Action UI. It is time-consuming and frustrating.
Custom DB queries, for example, have test data that is saved and available each time you open the window, could the API action do something similar?
An alternative, that could be hugely powerful in my opinion, would be a SC formatter such as .test()
that acts like kind of like default but is only parsed in the Wappler UI to fill values when fetching schema or for database connections etc… You could then have a section in Globals for ‘test values’ that it could pick from.
Just one example and a big use case for me is dynamic database connections. I have multi-tenancy built in to my platform where each client has their own DB and the connection is made based on their login. When working with the connection, I currently have to have a ‘test’ connection as well as the dynamic one. When adjusting queries, I have to use the test one that has fixed values before switching every single query to the dynamic one before publishing. If I miss one out by mistake (which is easy in some complex API files), it can be hugely problematic. Once set to the dynamic connection, the schema is not fetched for that connection and therefore not available in either server-side or client-side data pickers.
If, for example, the DB host could be set to {{somedynamicaddress.test($_test.dbhost)}}
or more simply {{somedynamicaddress.test('hostaddress')}}
(entered as a string)
it would mean I could use the one DB connection. The same principal could be used in the API Action Input Data/Headers/Query to send test data for fetching schema.
Last updated: