Giter Site home page Giter Site logo

Comments (6)

AlexRukhlin avatar AlexRukhlin commented on May 19, 2024

Hi,

(Just a side question: Which version of Java do you use?)

As a short workaround you could modify the line in ApiResourceEntityProvider to support both List and ArrayList.

We'll be glad to receive a Pull Request with your contribution.

Thanks,
Alex

from vso-httpclient-java.

henryju avatar henryju commented on May 19, 2024

I'm using Java 8. I can submit a PR, but I'm still thinking that exposing java.util.List instead of ArrayList would be cleaner. And since this is generated code, I'm not sure I should create a PR to change it. Or is the code of the generator available somewhere?

from vso-httpclient-java.

AlexRukhlin avatar AlexRukhlin commented on May 19, 2024

I agree with you that exposing java.util.List instead of ArrayList would be cleaner. Just in the current implementation, we can not use interfaces in places where deserialization is needed, e.g. in method return types.

You shouldn't change generated classes. You might see two types of sources - ones are generated the others are manually created. ApiResourceEntityProvider is a manually created class.

from vso-httpclient-java.

henryju avatar henryju commented on May 19, 2024

During my tests, I have changed for example the return type of GitHttpClientBase.getPullRequestIterations() to java.util.List and it was working fine. Are we talking about the same thing?

from vso-httpclient-java.

AlexRukhlin avatar AlexRukhlin commented on May 19, 2024

Yes, we do. You might see that in GitHttpClientBase.getPullRequestIterations() the type ArrayList<GitPullRequestIteration> is used two times - as the method's return type and as a part of the parameter in the super.sendRequest call specifying the deserialization target type, i.e. the response type. Sorry, in my previous comment, I used the same term "return type" for both. That was confusing. :-(

Manually, you've changed only the result type. Correct? As I said, in the current implementation of the REST Client Generator, we cannot do that. We're planing its improvement, but but do not have ETA yet.

That's why I've suggested the short workaround.

from vso-httpclient-java.

henryju avatar henryju commented on May 19, 2024

Manually, you've changed only the result type. Correct?

No, I changed both. I will prepare a P/R to show you

from vso-httpclient-java.

Related Issues (4)

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.