Open nikhilwoodruff opened 2 years ago
@sandcha @MattiSG @maukoquiroga @guillett : do you remember why we forbid string parameters ?
@nikhilwoodruff Do you have all the information you need about the Web API test suggested above?
@nikhilwoodruff Do you have all the information you need about the Web API test suggested above?
Thanks @MattiSG and @sandcha - not sure I fully understand what exactly the Web API should test for, could you provide any more detail?
The test you added tests the Python API of OpenFisca 👍 That's a great starting point!
However, by enabling new data types to be exposed, this changeset also changes the Web API (the module that exposes parameter values and calculations over RESTful HTTP). The web API is packaged in its own module (web_api
at the root of the repository, alongside core
). In order to ensure that the parameters are also properly exposed over the Web API, you need to also add tests for that behaviour 🙂
This is done by editing the tests/web_api/test_parameters.py
file. I suggest that you add a new test that would try to get
a String value. For that, you will need to add one such parameter in the Country Template, which will also enable discovery for new users.
Finally, of course, updating the documentation would be a great final touch for users to know about this new feature 😉
This PR fixes #1092 by supporting string parameters. I've added a test for it, and removed an old test which would now be incorrect (testing that a string parameter fails).