MunifTanjim / node-bitbucket

Bitbucket API client for Browser and Node.js
https://bitbucketjs.netlify.app
MIT License
106 stars 28 forks source link

Deploy.createKey route should also take key and label parameter to be sent in body #42

Closed bbathel13 closed 4 years ago

bbathel13 commented 4 years ago

The bitbucket api to create deploy keys takes two body fields, key and label, which are not included in the node-bitbucket route. It currently only allows for username and repo_slug which are used in the path.

currently:

"createDeployKey": {
      "method": "POST",
      "params": {
        "repo_slug": {
          "in": "path",
          "required": true,
          "type": "string"
        },
        "username": {
          "in": "path",
          "required": true,
          "type": "string"
        },
      },
      "returns": "DeployKey",
      "url": "/repositories/{username}/{repo_slug}/deploy-keys"
    },`

I think it should look more like this:

"createDeployKey": {
      "method": "POST",
      "params": {
        "repo_slug": {
          "in": "path",
          "required": true,
          "type": "string"
        },
        "username": {
          "in": "path",
          "required": true,
          "type": "string"
        },
        "label":{
          "in":"body",
          "required":true,
          "type":"string"
        },
        "key":{
          "in":"body",
          "required":true,
          "type":"string"
        }
      },
      "returns": "DeployKey",
      "url": "/repositories/{username}/{repo_slug}/deploy-keys"
    },