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

Make interface types nullable/optional #74

Closed
samiraguiar opened this issue Feb 2, 2017 · 6 comments · Fixed by #248
Closed

Make interface types nullable/optional #74

samiraguiar opened this issue Feb 2, 2017 · 6 comments · Fixed by #248
Assignees

Comments

@samiraguiar
Copy link

samiraguiar commented Feb 2, 2017

Some interfaces, like GitPullRequest, contain a lot of members that are not mandatory according to the API docs.

For example, when creating a pull request, we need a GitPullRequest object. This has a lot of mandatory members but the API has only 4 or 5 parameters.

Is it possible to make them nullable?

@nickpape
Copy link

nickpape commented Jul 18, 2017

Completely agree, it makes the typings somewhat useless, as I have to use any to typecast everything.

Are these interfaces generated or can we update them manually? @scottdallamura @scottdallamura2

@scottdallamura2
Copy link
Contributor

scottdallamura2 commented Jul 18, 2017 via email

@octogonz
Copy link

How soon will this get implemented? If it's going to be a while, maybe we can refresh the DefinitelyTyped typings and manually fix the issues there? That would be a quick temporary workaround.

@lukewis
Copy link

lukewis commented Oct 19, 2017

More of a question than a comment, but how do I access these interfaces in my own code? It seems that I can only access those exposed by index.d.ts?

@nadavsinai
Copy link

nadavsinai commented Nov 14, 2017

@lukewis for example

import {GitPullRequest} from 'vso-node-api/interfaces/GitInterfaces';

and then

 await git.createPullRequest(({
			title: title,
			description: description || '',
			sourceRefName: sourceBranch,
			targetRefName: taregtBranch
		} as GitPullRequest), repositoryID, projectID);

for your partial casting

@damccorm
Copy link

I have a PR pending for the code generation that should fix this. Once that's through we can regenerate and push here.

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

Successfully merging a pull request may close this issue.

7 participants