This week I began putting together a development document for developing APIs and endpoints. The first pass should be up shortly.
I continued working on my open pull requests, in particular the pull request for fleshing out the errors thrown by our REST framework, and I figured it would be a good place to do a bit of refactoring our validation code. Instead of having a tightly coupled validation module with one method per endpoint, I decided to have only a method that takes a request form and a schema to validate it against. In some APIs we will hardcode the schemas into a dict contained by the blueprint (recording api for example), but for request forms that mirror existing classes (Config API for example) there is a schema method that will generate a schemas at runtime. Either way, the main idea is that we keep the actual schemas away from the validate module, unlike in the past.
I had to make some changes to the test_validate.py module and I ended up making it more pytest-ish instead of unittest-ish.
Next week and beyond:
Finish up development document.
Close all open pull requests
Look at what tests should be added to improve test coverage. Implement new ones if necessary.
No comments:
Post a Comment