jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

Flask_apispec version of `@use_kwargs` not compatible with `unknown` parameter #242

Open quaxsze opened 2 years ago

quaxsze commented 2 years ago

When using @use_kwargs with the unknown parameter, to be able to use the unknown parameter of the schema, as described here in the webargs documentation:

class RandomSchema(Schema):
    class Meta:
        unknown = EXCLUDE

@use_kwargs(RandomSchema, location="json", unknown=None)

The following exception is raised: TypeError: schema2parameters() got an unexpected keyword argument 'unknown' Would it be possible for flask_apispec version of @use_kwargs to support this parameter? I could use the webargs version of @use_kwargs but it won't annotate the schema for swagger isn't it?