Comments (6)
Ok, it obviously is wrong to serialize an object to a plain string. I'll close and re-open with the real problem.
from klaxon.
from klaxon.
So, is it invalid to have a structure of
val people = listOf(person1, person2)
serialize to
["1:John", "2:Jane"]
?
from klaxon.
from klaxon.
According to jsonlint.com
it's fine. The standard on json.org
doesn't explicitly state it to be invalid.
from klaxon.
There was indeed a mistake in my serializer. I needed to surround the result in quotes. I now no longer get parsing exceptions, but I still get cast exceptions. It seems that your converter only allows json objects to be at the root of a document, when, in reality, a json array can be a valid start of the document.
from klaxon.
Related Issues (20)
- Unable to parse Boolean HOT 1
- Parsing number values HOT 1
- Parsing jsons with nullable fields - `serializeNull = false` as a default?
- [Bug] Unsigned numbers not correctly serialized
- Add support for JSON Lines HOT 1
- `JsonObject` created by `toJsonObject` from a derived class will not contain members of any superclass. HOT 1
- Docs are not clear on now to process a stream of json objects.
- Failure parsing json into class with primary constructor with parameters not specifying var or val
- Using a TypeAdapter with a default class for null?
- Unable to instantiate MyClass
- No accessors or field is found for property var XXXXXX: kotlin.String?
- KlaxonDoc.java got compiled to Java 11 byte code HOT 1
- Using Klaxon in Gradle Task
- Fails to handle case where enum is the key of a map inside a data class
- Optional property HOT 1
- A
- Is there any way to configure or modify the parsing such that Klaxon can handle `NaN` in input?
- [BUG] Decimal conversion in `toJsonString` depends on system locale and uses wrong separator
- FieldRenamer overrides @Json name annotation
- Not escaping quotes or orther special characters when calling parseArray HOT 1
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 klaxon.