I really enjoy OpenFisca, but I recently encountered an issue.
Here is what I did:
I ran openfisca serve on OpenFisca France v61.0.0.
Here is what I expected to happen:
The Web API starts.
It replies with HTTP 200 and works as documented.
Here is what actually happened:
The Web API starts.
When accessing it over HTTP, it crashes and tells me:
KeyError: 'cotsoc/gen/smic_h_b'
i/app.py", line 62, in create_app
data = build_data(tax_benefit_system)
File "/Users/mesaides/Documents/openfisca-france/.venv/lib/python3.8/site-packages/openfisca_web_api/loader/__init__.py", line 22, in build_data
data['openAPI_spec'] = build_openAPI_specification(data)
File "/Users/mesaides/Documents/openfisca-france/.venv/lib/python3.8/site-packages/openfisca_web_api/loader/spec.py", line 42, in build_openAPI_specification
parameter_example = api_data['parameters'][parameter_path]
KeyError: 'cotsoc/gen/smic_h_b'
Here is data (or links to it) that can help you reproduce this issue:
Install OpenFisca-France @ d68d103, start the Web API, and try to access it (v61.0.0 has been yanked because of this).
Solution
The problem was actually that the parameter_example set up in the web API config did not exist in the tax and benefit system anymore, as can be seen in https://github.com/openfisca/openfisca-france/pull/1609. I expect that variable_example and simulation_example would lead to the same result.
I would have liked that the Web API tells me up front, when starting up (as opposed to when being accessed) that this key does not exist in the tax and benefit system, and that the error was clearer.
Hi there!
I really enjoy OpenFisca, but I recently encountered an issue.
Here is what I did:
I ran
openfisca serve
on OpenFisca France v61.0.0.Here is what I expected to happen:
Here is what actually happened:
Here is data (or links to it) that can help you reproduce this issue:
d68d103
, start the Web API, and try to access it (v61.0.0 has been yanked because of this).Solution
The problem was actually that the
parameter_example
set up in the web API config did not exist in the tax and benefit system anymore, as can be seen in https://github.com/openfisca/openfisca-france/pull/1609. I expect thatvariable_example
andsimulation_example
would lead to the same result.I would have liked that the Web API tells me up front, when starting up (as opposed to when being accessed) that this key does not exist in the tax and benefit system, and that the error was clearer.
Context
I identify more as a: