Skip to content

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

@jedevc

Description

@jedevc

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?

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