netlify / netlify/open-api

`/sites/{site_id}/deploys/{deploy_id}/restore` returns 200 instead of 201

Open
#553 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
323
Forks
133
Avg merge
2d 8h
Merged PRs (30d)
2

Description

restoreSiteDeploy is documented as returning 201 on creation.

https://github.com/netlify/open-api/blob/166c074a16e7b753980a25579b6c77e432ea8af5/swagger.yml#L1164-L1183

However, in practice, it appears that this API instead returns 200 on success. When using the go API, this gives the following error:

unexpected success response: content available as default response in error (status 200): {"Payload":{"message":""}}

https://github.com/netlify/open-api/blob/166c074a16e7b753980a25579b6c77e432ea8af5/go/plumbing/operations/operations_client.go#L3905-L3907

(even though the operation has succeeded, and the deployment has been correctly restored).

It should be pretty easy to update the spec - but also not sure whether maybe the API is instead returning the incorrect status?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the restoreSiteDeploy response definition in swagger.yml at lines 1164-1183 and the generated handling in go/plumbing/operations/operations_client.go at lines 3905-3907. Verify the successful status returned by the restore endpoint and align the specification or API behavior so a successful restore does not produce a Go client error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.