Giter VIP home page Giter VIP logo

vso-httpclient-java's Introduction

vso-httpclient-java

Microsoft Visual Studio Team Services HTTP Client for Java

vso-httpclient-java's People

Contributors

alexrukhlin avatar davidstaheli avatar im-harshal avatar leantk avatar msftgits avatar olivierdagenais avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vso-httpclient-java's Issues

Unable to create a pull request status without passing an iterationId

According to the documentation, it should be possible to create a PR status without specifying an iterationId: https://www.visualstudio.com/en-us/docs/integrate/api/git/pull-requests/pullrequeststatuses

Pull request statuses can be posted on the overall pull request or on the specific pull request iteration.

It is said that you can pass the iterationId, not that you should

Note that you can specify iterationId in the request body to post the status on the iteration.

But if I try:

    GitPullRequestStatus status = new GitPullRequestStatus();
    GitStatusContext context = new GitStatusContext();
    context.setGenre("Foo");
    context.setName("Bar");
    status.setContext(context);
    status.setState(statusState);
    status.setDescription(statusDescription);
    status.setTargetUrl(targetUrl);
    // Don't set iterationId on the status
    gitHttpClient.createPullRequestStatus(status, gitRepo.getId(), pullRequest.getPullRequestId());

It fails with:

com.microsoft.alm.client.model.VssServiceException: The value 0 is outside of the allowed range.
Parameter name: iterationId
Actual value was 0.
at com.microsoft.alm.visualstudio.services.webapi.WrappedException.Unwrap(WrappedException.java:193)
at com.microsoft.alm.client.VssHttpClientBase.handleResponse(VssHttpClientBase.java:235)
at com.microsoft.alm.client.VssHttpClientBase.sendRequest(VssHttpClientBase.java:213)
at com.microsoft.alm.client.VssHttpClientBase.sendRequest(VssHttpClientBase.java:218)
at com.microsoft.alm.teamfoundation.sourcecontrol.webapi.GitHttpClientBase.createPullRequestStatus(GitHttpClientBase.java:11472)

I think the problem com from the fact that GitPullRequestStatus#iterationId should be an Integer and accept null values.

Unable to deserialize collections

Any API returning a collection fail to be deserialized.

Can not deserialize instance of java.util.ArrayList out of START_OBJECT token
at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@7586beff; line: 1, column: 1]

This is because ApiResourceEntityProvider will unwrap collections when the target object is of type java.util.List, but generated code make use of ArrayList. And List != ArrayList.

I suggest to fix the generator to replace ArrayList by List (this is a good practice in Java to not expose implementation in APIs).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.