Skip to content

Commit

Permalink
#15: Create class wrapper to collect endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jul 25, 2019
1 parent 134e74f commit c955db0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/swagger/swagger_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@ class SwaggerGenerator(object):
def __init__(self):
self.endpoints = []

pass
def resource_wrapper(self):
"""
Wrapper for Resource classes that appends the class name to the endpoints list
"""

def decorate(cls):
self.endpoints.append(cls.__name__)
return cls

return decorate

0 comments on commit c955db0

Please sign in to comment.