Removing Option wrappers from GitPullRequest
breaks pull request create
#23
Labels
bug
Something isn't working
GitPullRequest
breaks pull request create
#23
The
git::pull_requests
create()
function takes aGitPullRequest
struct, which is the same struct returned when querying pull requests. There are many fields in here which are created/managed by the server (e.g.id
,url
).I removed a bunch of
Option
wrappers onGitPullRequest
to make the returned pull request struct easier to use (see #6), including theid
andurl
fields. However these values obviously cannot/should not be provided when creating a pull request.The simple fix is to back out the changes that make these fields required (i.e. restoring option wrappers). However, this isn't ideal as the set of mandatory and optional fields on creation is not encoded/enforced by the crate types. A better solution would therefore to be to replace the create parameter type with a new struct that contains only the valid parameters for pull request create operations. This is fairly easy to implement via
vsts-api-patcher
. Figuring out which fields are valid on a pull request create operation is another matter (as it isn't defined by the API docs!).The text was updated successfully, but these errors were encountered: