You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
Activity
joschrew commentedon 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 commentedon 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 aFileResponse. The return type could be decided based on another flag, not theaccept.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
curlin our tests for these specific cases instead of trying workaround hacks.