Skip to content
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

Multipart response #402

Open
RedekG opened this issue Sep 12, 2022 · 1 comment
Open

Multipart response #402

RedekG opened this issue Sep 12, 2022 · 1 comment

Comments

@RedekG
Copy link

RedekG commented Sep 12, 2022

Hi!

I achieved multipart request and i was wondering if there is a way to have a multipart response.

The following code does not work for multipart response.

class Metadata(Schema):
    meta1 = fields.Str(required=True)
    meta2 = fields.Str(required=True)
    meta3 = fields.Str(required=True)

class FileUpload(Schema):
    file = Upload()
   
class MultipartResponse(Schema):
    field1= fields.Str(required=True)
    field2 = fields.Str(required=True)
    field3 = fields.Str(required=True)
    field4 = fields.Str(required=True)
    file = Upload()
    
    
@classmethod
@EdcBlp.route("/filetransfer")
class FileTransfer(MethodView):

    @classmethod
    @EdcBlp.response(200,MultipartResponse(), content_type="multipart/form-data")
    def get(cls):
        pass

    @classmethod
    @EdcBlp.arguments(Metadata(), location="query")
    @EdcBlp.arguments(FileUpload(), location="files")
    def post(cls):
        pass
@kettenbach-it
Copy link

Would be interested in a solution as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants