Added update_spec function

This commit is contained in:
jtc42 2020-01-02 23:52:46 +00:00
parent 5bdb6764be
commit bcfc8e6eeb
2 changed files with 9 additions and 6 deletions

View file

@ -11,6 +11,11 @@ from marshmallow import Schema as BaseSchema
from collections import Mapping
def update_spec(obj, spec):
obj.__apispec__ = obj.__dict__.get('__apispec__', {})
rupdate(obj.__apispec__, spec)
return obj.__apispec__
def view2path(rule: str, view: Resource, spec: APISpec):
params = {
"path": rule, # TODO: Validate this slightly (leading / etc)