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

422 on downloading zip via /docs navigation #2

Open
joschrew opened this issue Aug 2, 2022 · 2 comments
Open

422 on downloading zip via /docs navigation #2

joschrew opened this issue Aug 2, 2022 · 2 comments

Comments

@joschrew
Copy link
Collaborator

joschrew commented Aug 2, 2022

No description provided.

@joschrew
Copy link
Collaborator Author

joschrew commented Aug 13, 2022

zip download does not work with accept-header and fastapi's generated-swagger-client (the ui you get at /docs). There only application/json can be set as accept header.
www.github.com/tiangolo/fastapi/issues/4438

@MehmedGIT
Copy link
Collaborator

MehmedGIT commented Nov 21, 2022

Since this is the accept header of the request, we can still return responses that are not application/json. Yes, that's not a proper way to do that but at least we will have working test cases that can verify the content. When we find a proper way to achieve the same, we can change it.

Here, instead of returning a WorkspaceRsrc, we could return a FileResponse. The return type could be decided based on another flag, not the accept.
https://github.com/OCR-D/ocrd-webapi-implementation/blob/main/ocrd_webapi/routers/workspace.py#L61-L81

EDIT: We should maybe just consider testing by using curl in our tests for these specific cases instead of trying workaround hacks.

@MehmedGIT MehmedGIT reopened this Nov 21, 2022
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