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

📚 Documentation: Return Type for Download Deployment is Wrong #810

Open
2 tasks done
ItzNotABug opened this issue Oct 6, 2023 · 4 comments
Open
2 tasks done
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ItzNotABug
Copy link
Contributor

💭 Description

This Download Deployment method shows the Response as [200] application/json but this in-fact returns a tar.gz of the requested deployment.


The Response from Postman -
Content-Type: application/gzip
Content-Disposition: attachment; filename="************.tar.gz"

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@namansharma18899
Copy link

@ItzNotABug I'm agree with the issue you raised. Not only it's wrong but as of August 2012, the MIME type recommended in [RFC 6713] is application/gzip so application/tar & application/zip will be incorrect as well.

I would like to raise a PR for this if it seems fit 😄

@namansharma18899
Copy link

@ItzNotABug can you assign me this one.

@AnanyaJindal1145
Copy link

@ItzNotABug Can I be assigned this issue?

@EVDOG4LIFE EVDOG4LIFE self-assigned this Mar 20, 2024
@EVDOG4LIFE EVDOG4LIFE transferred this issue from appwrite/appwrite Mar 20, 2024
@EVDOG4LIFE EVDOG4LIFE added bug Something isn't working good first issue Good for newcomers labels Mar 20, 2024
@stnguyen90
Copy link
Contributor

stnguyen90 commented May 31, 2024

The problem with this is our openapi specs don't have anything for the content when the content is binary. Compare:

Get file:

      "get": {
        "summary": "Get file",
        "operationId": "storageGetFile",
        "tags": ["storage"],
        "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.",
        "responses": {
          "200": {
            "description": "File",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/file" }
              }
            }
          }
        },

with Download deployment:

      "get": {
        "summary": "Download Deployment",
        "operationId": "functionsDownloadDeployment",
        "tags": ["functions"],
        "description": "Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download.",
        "responses": { "200": { "description": "File" } },

If we fix the specs, we can stop hardcoding the response type:

<span class="web-caption-400">application/json</span>

The fix probably needs to happen somewhere in here.

@stnguyen90 stnguyen90 added help wanted Extra attention is needed and removed good first issue Good for newcomers labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants