Skip to content

Successful PUT to /deploys/{deploy_id}/files/{path} returns capitalized keys #256

@kaganjd

Description

@kaganjd

https://community.netlify.com/t/api-endpoint-deploys-deploy-id-files-path-randomly-gives-strange-results/22091/

The OP noted that a successful PUT request returns:

  {
    ID: '/static/2555efdf6712bc438581a141651552c2eb423ab6/photo-1598454242110-0744560ec77e.jpg',
    Path: '/static/2555efdf6712bc438581a141651552c2eb423ab6/photo-1598454242110-0744560ec77e.jpg',
    SHA: '2555efdf6712bc438581a141651552c2eb423ab6',
    MimeType: 'image/jpeg',
    Size: 170443
  }

whereas the docs (https://open-api.netlify.com/#operation/uploadDeployFile) show the returned object as:

{
    "id": "string",
    "path": "string",
    "sha": "string",
    "mime_type": "string",
    "size": 0

}

I think this is the server code for the response: https://github.com/netlify/netlify-server/blob/dee71a22aa145d66897c0c1ba62ebc3269bae6e3/server/request_file_upload.go#L45-L51

We should either lowercase the keys or update the open-api docs to show the capitalized keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions