I am currently working on a project using Flask to make REST apis, blablabla. But, working with request validation tools that we use, I am thinking of whether it would be necessary to validate the responses of the controllers.

I read a bit about Design by contracts and I saw how it was done in Eiffel programming language but, I was thinking of a way this could be applied to back-end development.

Is there any need to validate the request and the response in app code or this could be handled by the API specs?

  • 1
    What do you mean by "validate?" Jul 3 '21 at 1:18
  • Take for instance, an adding controller will take a number attribute in the body and will return a body response body with a result attribute Jul 3 '21 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.