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

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

Open
jedevc opened this issue Dec 12, 2024 · 0 comments
Open

Comments

@jedevc
Copy link

jedevc commented Dec 12, 2024

restoreSiteDeploy is documented as returning 201 on creation.

open-api/swagger.yml

Lines 1164 to 1183 in 166c074

/sites/{site_id}/deploys/{deploy_id}/restore:
post:
operationId: restoreSiteDeploy
tags: [deploy]
parameters:
- name: site_id
type: string
in: path
required: true
- name: deploy_id
type: string
in: path
required: true
responses:
'201':
description: Created
schema:
$ref: '#/definitions/deploy'
default:
$ref: '#/responses/error'

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":""}}

// unexpected success response
unexpectedSuccess := result.(*RestoreSiteDeployDefault)
return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code())

(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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant