question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deserialize arrays

See original GitHub issue

I tried to deserialize an array of items like this:

this.authHttp.get('/items')
  .map(response => deserialize(Item[], response.json()))
  .catch(this.handleError)
  .subscribe(data => console.log(data));

But the compiler didn’t like it. How can I fix this?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
jf3096commented, Mar 3, 2017

@Geschan for now the first parameter of the deserialize method accept object. I will consider your case and add this feature soon.

1reaction
WilliamChelmancommented, Mar 2, 2017

You could try something like

this.authHttp.get('/items')
  .map(response => response.json().map(item => deserialize(Item, item)))
  .catch(this.handleError)
  .subscribe(data => console.log(data));
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deserialize a JSON array in C# - Stack Overflow
Deserialize a JSON array in C# ; bool status = true ; byte[] readBuffer = null ; try { // Combine the new...
Read more >
Deserializing a JSON array string into a C# object
Deserializing a JSON array string into a C# object. Hi, Everybody! I need some help… I wish to deserialize a JSON string into...
Read more >
Deserialize a Collection - Json.NET
This sample deserializes JSON into a collection.
Read more >
Jackson - Unmarshall to Collection/Array | Baeldung
This tutorial will show how to deserialize a JSON Array to a Java Array or Collection with Jackson 2. If you want to...
Read more >
Array or object JSON deserialization (feat. .NET & System.Text ...
This is a post about one of such situations, resorting to some JSON deserialization trickery (via JsonConverter ) to be able to get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found