Skip to content

Raise error when trying to create parameter that accepts an array of files #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danielhauagge opened this issue Apr 26, 2016 · 0 comments

Comments

@danielhauagge
Copy link
Contributor

danielhauagge commented Apr 26, 2016

Apparently swagger 2.0 can't handle an array of files (see this issue on swagger's API) as a parameter, maybe flask-restplus should raise an error if the user tries to do this.

I ran into this while trying to add an argument with something like this

parser.add_argument('image', type=load_image, location='files',
                    required=True, action='append')

The swagger specification that is generated for that parameter looks like

{
    "collectionFormat": "multi", 
    "description": "", 
    "in": "formData", 
    "items": {
        "type": "file"
    }, 
    "name": "image", 
    "required": true, 
    "type": "array"
}, 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants