Comments (7)
From [email protected] on August 29, 2011 11:11:43
Note that the limitation with erasure in Java is that all generic type information is lost, so we would end up parsing essentially into List, much like when we parse Map, we are parsing essentially into Map<Object, Object>.
Currently we are assuming that the parse method is parsing a JSON object, not a JSON array. So this feature request is to expand its use to also supporting parsing JSON array. There is a separate method called parseArray that is better than parse because it gives the generic type as a parameter when that is known.
Note also that this only applies when parsing directly into a List. If there is a field in an object we are parsing into of type List, this already works correctly today.
Summary: Parsing directly into a List
Status: Accepted
Labels: Milestone-Version1.7.0
from google-http-java-client.
From [email protected] on August 29, 2011 11:11:56
Labels: Component-JSON
from google-http-java-client.
From [email protected] on February 28, 2012 17:15:12
Labels: -Milestone-Version1.7.0 Milestone-Version1.8.0
from google-http-java-client.
From [email protected] on March 27, 2012 07:22:33
Labels: Milestone-Version1.9.0
from google-http-java-client.
From [email protected] on May 14, 2012 07:14:07
Labels: -Milestone-Version1.9.0 Milestone-Version1.10.0
from google-http-java-client.
From [email protected] on June 08, 2012 04:47:27
Labels: -Milestone-Version1.10.0 Milestone-Version1.11.0
from google-http-java-client.
From [email protected] on June 08, 2012 05:24:06
We've implemented the ability to parse into any Type now so that we can properly parse into List for example. You can use TypeToken from gson for this. Alternatively, just call parseArray. It's not a pretty situation, but hopefully it suffices for the power user like Alon. Marking as "Fixed" for now, but please let me know if you have any idea for improvement.
Status: Fixed
Cc: [email protected]
Labels: -Milestone-Version1.11.0 Milestone-Version1.10.0
from google-http-java-client.
Related Issues (20)
- Proguard/r8 instructions missing HOT 3
- Investigate and Implement `shutdown()` and `isShutdown()` for NetHttpTransport HOT 12
- I encountered this issue when using the Java backend to dock with Firebase's FCM, which has been bothering me for a long time. I saw the relevant SDK stating that refreshing tokens is automatically done by the Firebase SDK
- `google-http-client/src/main/java/com/google/api/client/util/SslUtils.java` contains code that looks unsafe and so triggers TrustAllX509TrustManager on Android Lint
- Micrometer Observation Support HOT 2
- question related to grpc vulnerabilities HOT 2
- Evaluate the java.net.http.HttpClient as HTTP client backend
- Triggering release workflow HOT 1
- Set minimum permissions for workflows
- HTTP/2 Support HOT 1
- Dependency `opencensus` is no longer maintained HOT 4
- Warning: a recent release failed
- Warning: a recent release failed HOT 1
- Allow customizations for the socket configurations
- PLEASE READ HOT 1
- External documentation is outdated - latest published version is 1.43.2
- Renovate bot is no longer automatically opening depedency update PRs HOT 2
- Dependency: DOS issue reported by Snyk with outdated jackson-core version 2.14.2
- deps: update github/codeql-action action to v3
- build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-http-java-client.