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.

Unable to parse generics on 1.3.0

See original GitHub issue

Ktor Version and Engine Used (client or server and name) Ktor Version: 1.3.0

Describe the bug My generic classes can’t be parsed on 1.3.0

To Reproduce I have this Response class

@Serializable
class Response<T> {
    val status: Int,
    val message: String,
    val data: T
}

for this response:

{
    status: 200,
    message: "Success",
    data: { ... }
}

It errors with a message that the only generic classes for now are standard collections.

This works on 1.2.6

Expected behavior It should be able to parse the generic Response class

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
e5lcommented, Jan 22, 2020

Hi @kuuuurt, thanks for the report. As I see this is the current limitation of kotlinx.serialization. It’ll be fixed in the next serialization release.

0reactions
e5lcommented, Mar 20, 2020

Nope. Fixed in 1.3.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

java generic String to <T> parser - Stack Overflow
//Attempt to instantiate an object of type T from the given input string //Return a default value if parsing fails static <T> T...
Read more >
Unable to Parse Result Set 'AFEnvironmentConfiguration ...
Content server says "RUNNING" but user can only login to UCM admin server, and cannot view logs. In addition, the Managed Attachments screen ......
Read more >
Java Programming Tutorial on Generics
Introduction. JDK 5 introduces generics, which supports abstraction over types (or parameterized types) on classes and methods. The class or method designers ...
Read more >
Constantly getting this error while training Deep and Wide ...
Failed to load entrypoint azureml.PipelineRun = azureml.pipeline.core.run:PipelineRun._from_dto with exception (azure-mgmt-core 1.3.0 ...
Read more >
CocoaPods Fails On Apple Silicon | Apple Developer Forums
uninstalling the cocoapods package through gem (sudo gem uninstall cocoapods) and reinstalling it with homebrew (brew install cocoapods) fixed my problem.
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