Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate objects coming via API in BE via the integrated validator #589

Closed
tomaspavlin opened this issue Mar 23, 2021 · 2 comments · Fixed by #952
Closed

Validate objects coming via API in BE via the integrated validator #589

tomaspavlin opened this issue Mar 23, 2021 · 2 comments · Fixed by #952
Assignees
Labels
backend Backend related task/PR

Comments

@tomaspavlin
Copy link
Contributor

tomaspavlin commented Mar 23, 2021

  1. remove todo on line 33 in file namespace.py - we will have only validation via route_utils request_body function
  2. check that everywhere we are using request_body function to get object from request body (we dont do it for example in matching_api.py
  3. on line 234 in error handler.py there is logger.error(f'Unexpected error code returned {error_code}, returning 500 instead') but it does not make sense there, put this logging to correct place
  4. add validations to all objects we are using request_body function for. In some cases we do it (for example for patients we do not allow height negative etc. But for example for configuration we do not do that. Add the validation there as well. (use fronted or ask if you are not sure what the valid values are)
@tomaspavlin tomaspavlin added backend Backend related task/PR technical debt nice to have nice to have things, not urgent for the milestone and removed technical debt labels Mar 23, 2021
@kubantjan kubantjan removed the nice to have nice to have things, not urgent for the milestone label Jul 11, 2022
@kubantjan kubantjan linked a pull request Jul 13, 2022 that will close this issue
@kubantjan kubantjan changed the title Validate config and patient parameters in BE Validate config and patient parameters in BE via the integral validator Jul 13, 2022
@kubantjan kubantjan changed the title Validate config and patient parameters in BE via the integral validator Validate objects coming via API in BE via the integrated validator Jul 13, 2022
@kubantjan kubantjan removed the hiring label Jul 18, 2022
@krllstdn
Copy link
Contributor

@kubantjan Is it necessary to create ConfigParametersDTO in CalculateFromConfig endpoint for request_body() or we can just use ConfigParameters? Because creating ConfigParametersDTO would mean code dublication.

@kubantjan
Copy link
Member

No need :) We would just create it in case there would be some difference needed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment