Code Monkey home page Code Monkey logo

Comments (12)

jianghaolu avatar jianghaolu commented on June 26, 2024 1

From the jackson-core thread it seems like I have to find a way to deserialize from a Type without creating a TypeReference.

from autorest-clientruntime-for-java.

jianghaolu avatar jianghaolu commented on June 26, 2024 1

I'm planning to ship 1.0.0 tomorrow!

from autorest-clientruntime-for-java.

dadoonet avatar dadoonet commented on June 26, 2024

I opened FasterXML/jackson-core#347 to track it also on Jackson side based on this elastic/elasticsearch#22679 (comment).

from autorest-clientruntime-for-java.

jianghaolu avatar jianghaolu commented on June 26, 2024

Just out of curiosity, does guava's new TypeToken() constructor have similar issues? like this: https://github.com/Azure/azure-sdk-for-java/blob/master/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java#L474

from autorest-clientruntime-for-java.

dadoonet avatar dadoonet commented on June 26, 2024

Thanks!

from autorest-clientruntime-for-java.

cowtowncoder avatar cowtowncoder commented on June 26, 2024

I know this is a late comment, but looking at the original question I am wondering why the code does not use:

mapper.constructType(type)

to get JavaType to pass instead of TypeReference. This would probably hit the same problem, of course, but is bit more straightforward to use. Use of TypeReference here does not achieve anything as it is meant to pass compile-time signature which is not being passed here.

from autorest-clientruntime-for-java.

jianghaolu avatar jianghaolu commented on June 26, 2024

Ha! @cowtowncoder we just started using that a couple days ago: https://github.com/Azure/autorest-clientruntime-for-java/blob/master/client-runtime/src/main/java/com/microsoft/rest/serializer/JacksonAdapter.java#L118

from autorest-clientruntime-for-java.

cowtowncoder avatar cowtowncoder commented on June 26, 2024

@jianghaolu Ah ok. Makes more sense!

from autorest-clientruntime-for-java.

jianghaolu avatar jianghaolu commented on June 26, 2024

@cowtowncoder I don't see any underlying calls to getGenericSuperclass() in constructing the JavaType, which was what's causing the problem according to elastic/elasticsearch#22679 (comment).

from autorest-clientruntime-for-java.

cowtowncoder avatar cowtowncoder commented on June 26, 2024

@jianghaolu There should be calls, indirectly, since that is the only way to resolve generic type parameterization, but it is possible that the problem only occurs for some specific case: that is, many/most calls to getGenericSuperclass() should work just fine. For example, perhaps issues are related to non-static inner-classes, like what occurs with sub-classing of TypeReference as anonymous inner class.

from autorest-clientruntime-for-java.

jianghaolu avatar jianghaolu commented on June 26, 2024

@cowtowncoder make sense. I'll keep it as this unless the problem isn't resolved or re-occurs. Thanks for your input!

from autorest-clientruntime-for-java.

dadoonet avatar dadoonet commented on June 26, 2024

@jianghaolu Do you plan to release a new Beta version of this module?

from autorest-clientruntime-for-java.

Related Issues (20)

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.