-
Type: New Feature
-
Status: Resolved
-
Priority: Minor
-
Resolution: Won't Do
-
Affects Version/s: NoVersionApplicable
-
Fix Version/s: NoVersionApplicable
-
Component/s: Core
-
Tags:
-
Team:DRIVE
-
Story Points:2
The idea is to be able to alert the developer that a given API is not available on the server in use.
For instance, if the server version is 9.10, then Comment API is not available. And that code will always fail:
doc.comments()
doc.comment("My new comment")
I the server.log, such errors will be visible:
Service comment not found for object: /nuxeo/site/api/v1 of type APIRoot Service comment not found for object: /nuxeo/site/api/v1/id/<DOCUID> of type Documen
To prevent that, I propose to create a @since decorator used for each and every method to specifiy the minimum server version:
@since("10.3") def comment(self, ...): pass @since("10.3") def comments(self, ...): pass
The decorator will have access to the current server version (not yet decided how) and will raise a custom exception.