mozilla-services/cornice — pull request #60 by ametaireau (2012-05-10 16:41:59+00:00)
Title: Refactor cornice internal implementation

Change all the internal implementation of cornice services. This fixes #40. The logic is now separated between service description and registration in the pyramid routing system. This allows among other things to use cornice.service as a service description layer, and not as a way to register services into the routing
mechanism.

The routing facilities are contained in the pyramid_hook module. This PR also adds a bunch of tests and make sure to not break the existing API. One thing evolved, though, the `schemas` attribute of services is still present but is now deprecated. One should use `service.get_schemas` to get the schemas registered for a particular service/method. This is made this way because multiple schemas could be registered for one HTTP verb.

As a result of the implementation change, the code is now more readable and simpler to use. One benefit is that the services instance now have a "hook_view" method which attach a service definition to a function.

This PR fixes also #39 so it's now possible to have class-level validators and filters.

Please, **don't merge this yet**, as it still breaks the documentation generation. This PR is here primarily for discussion, so we agree that the new implementation is the best one we can think of :-)