Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kotlinx.serialization.json.JsonParsingException: Invalid JSON at 24576: Unexpected end in string #360

Closed
jrocharodrigues opened this issue Feb 4, 2019 · 4 comments
Assignees

Comments

@jrocharodrigues
Copy link

Hi,

I'm using kotlinx.serialization 0.10.0 with ktor 1.1.2 on a multiplatform (Android & ios) project.

When i run my app in android everything works fine, but on ios, the deserialization fails for the same request (with the same answer) with kotlinx.serialization.json.JsonParsingException: Invalid JSON at 24576: Unexpected end in string.

I've done some tests and the error only occurs if the length of my json is bigger then:

  • 16384 - if the json body is all in one line

  • 32768 - if the json has mutiple lines

If my json is smaller than that all works fine also on ios.

Is there any limitation to the size of the json body on ios? If so is there any way to circumvent this?

@sandwwraith
Copy link
Member

This seems like a bug somewhere in ktor-client, we'll try to investigate this

@jrocharodrigues
Copy link
Author

jrocharodrigues commented Feb 5, 2019

Probably related with ktorio/ktor#787 ?

Edit: Referenced wrong issues

@sandwwraith
Copy link
Member

I suppose this is gonna be fixed by Kotlin/kotlinx-io#36

@jrocharodrigues
Copy link
Author

Forced the use of kotlinx-io-0.1.5-dev-4 and org.jetbrains.kotlinx:kotlinx-coroutines-io-0.1.5-dev-4 and confirm this issue is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants