MunifTanjim / node-bitbucket

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

Updated routes for Workspaces so that create- and updateWebhook include body #93

Open stefankohler opened 3 years ago

stefankohler commented 3 years ago

The Schema of workspaces.createWebhookForWorkspace and workspaces.updateWebhookForWorkspaces was missing a body to actually provide the webhook details. This is a required 'field' for the Bitbucket API

MunifTanjim commented 3 years ago

Hey @stefankohler , Thanks for the PR.

So, most of this library is actually generated from the Bitbucket's API Specification. The src/plugins/register-api-endpoints/routes.json file is generated too. So the next time that file is generated, your changes will go away.

Bitbucket's API Specification is generally buggy and has a lot of problems (like the one you found). To solve that, we have the specification/extras/paths.json file where we put the corrections. This file is applied on top of the Bitbucket's API Specification before the generation process is run.

So, you'll need to add these changes in the specification/extras/paths.json file. And then run the following commands:

# generate routes.json
yarn run generate:routes

# generate types-schemajson
yarn run generate:types-schema
stefankohler commented 3 years ago

Hi @MunifTanjim,

Thanks for having a look at the PR and for explaining how to actually fix it :)