Closed bpetit closed 2 years ago
As a possible solution for this, we could use a data validation library, like one of those : https://www.yeahhub.com/7-best-python-libraries-validating-data/ to ensure required fields are provided and don't break the app if empty.
I've used voluptuous a bit, but any of those would probably do the job.
The API should always send a valid answer independently of the completeness of the input value. In this case the API should retrieve a die_size _per_core of 0.289
This bug is due to an inversion of completed_cpu and component_cpu when calling verbose in component router. Verbose service try to access die_size of the uncomplete_component which is None.
I just pushed a fix in main branch and added a test that matches this specific case (incomplete CPU + verbose=true)
Bug description
Sending a request with incomplete data leads to a 500 error. Like :
To Reproduce
Ask for CPU impact with those data :
"units": 1, "core_units": 24, "family": "Skylake", "manufacture_date": "2017",
Add : "die_size_per_core": 2.0
Then you get a valid answer.
Expected behavior
Sending an incomplete requests returns a 2xx with a message field that explains why there is no data to return or unsatisfying data.
Additional context
Trying the API through the server agent bootstrapped during hackathon # 4, but this is probably not relevant here.