Open
Description
class World(Resource):
@api.marshal_with(bay_model, headers={"x-my-header": "description"})
def get(self, id):
reuturn {"hello": "world"}
Repro Steps (if applicable)
- Use a response specific header with marshal_with
- Get an unexpected keyword argument error
Expected Behavior
Make a response specific header doc
Actual Behavior
Raises error
Error Messages/Stack Trace
return marshal_with(fields, ordered=self.ordered, **kwargs)(func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: marshal_with.__init__() got an unexpected keyword argument 'headers'
Possible fix?
I think it can be fixed by adding headers={}
to __init__
in marshal_with.
def __init__(
self, fields, envelope=None, skip_none=False, mask=None, ordered=False, headers={}
):