Skip to content

422 on downloading zip via /docs navigation #2

Open

Description

@joschrew
No description provided.

Activity

  1. joschrew commented on Aug 13, 2022

    @joschrew
    CollaboratorAuthor

    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

  2. MehmedGIT commented on Nov 21, 2022

    @MehmedGIT
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions