https://kotlinlang.org logo
Join SlackCommunities
Powered by
# klaxon
  • c

    cedric

    03/11/2022, 5:57 PM
    I'm not quite sure what people use these days, and whether Java or Kotlin libraries have the preference (e.g. Jackson)
  • c

    cedric

    03/11/2022, 5:57 PM
    Your PR looks fine, and it comes with a test, happy to merge it
  • c

    cedric

    03/11/2022, 5:57 PM
    done
  • l

    Larry Meadors

    03/11/2022, 5:58 PM
    what are the odds that there could be release of that? 😬
  • c

    cedric

    03/11/2022, 5:58 PM
    I had a suspicion that might be your next question 🙂
  • l

    Larry Meadors

    03/11/2022, 5:58 PM
    haha
  • c

    cedric

    03/11/2022, 6:15 PM
    Done, 5.6 should appear on Maven Central in the next hours, please confirm when you see it
  • l

    Larry Meadors

    03/11/2022, 6:16 PM
    ❤️ thank you
  • l

    Larry Meadors

    03/11/2022, 10:04 PM
    @cedric - still no 5.6 in any of the repos i'm looking at (maven.org and mvnrepository.com)
  • c

    cedric

    03/12/2022, 5:30 AM
    It's there: https://search.maven.org/artifact/com.beust/klaxon/5.6/jar
  • l

    Larry Meadors

    03/12/2022, 6:19 PM
    yes it is - thanks so much for getting that out there, i owe you a beer or something
  • c

    cedric

    03/13/2022, 12:37 AM
    Thanks for the PR!
  • l

    Larry Meadors

    03/13/2022, 2:50 PM
    plugging this in to my project now - works perfectly and cleans up a lot of message pre-processing 🕺
  • c

    cedric

    03/13/2022, 6:57 PM
    Great!
  • a

    Andrew O'Hara

    08/07/2022, 6:39 PM
    Hey Cedric, have you heard of Moshi and Jackson considering migrating from
    kotlin-reflect
    to
    kotlinx-metadata
    ? It's supposed to be faster, and provides a nice reduction in binary size (3 MB to 1 MB). Have you considered performing a similar change? https://github.com/square/moshi/pull/1183 https://github.com/FasterXML/jackson-module-kotlin/issues/450
    l
    c
    • 3
    • 9
  • k

    Kasey Speakman

    08/29/2023, 2:09 AM
    Hi! I'm trying to use KlaxonSettings to not serialize null values but it doesn't appear to be there in 5.6. Is there a way to not serialize nulls in that version?
  • k

    Kasey Speakman

    08/29/2023, 3:31 PM
    Also is there a setting to remove extra whitespace from output?
    Copy code
    org.junit.ComparisonFailure: 
    Expected :{"a1":123,"a2":"abc"}
    Actual   :{"a1" : 123, "a2" : "abc"}
  • c

    cedric

    08/29/2023, 3:35 PM
    Hi Kasey. Been a while since I worked on Klaxon so I don't quite remember 🙂 Feel free to send a PR though
  • k

    Kasey Speakman

    08/29/2023, 3:36 PM
    Ah, ok. I like the API. 🙂
  • c

    cedric

    08/29/2023, 3:38 PM
    I like it too 😄
  • k

    Kasey Speakman

    08/29/2023, 3:39 PM
    I'm using it a bit non-standard
    Copy code
    val parser = klaxon.parser(kc)
    val o: T? = klaxon.maybeParse(parser.parse(StringReader(data)) as JsonObject)
  • k

    Kasey Speakman

    08/29/2023, 3:54 PM
    Looks like I need to directly use
    fromJsonObject
    to instantiate subclass, then cast to sealed class
  • r

    robstoll

    11/02/2023, 8:15 AM
    Is there a way to let Klaxon fail if the json is not valid? For instance, klaxon ignores trailing commas or even double commas. something like:
    Copy code
    println(com.beust.klaxon.Klaxon().parseJsonArray(StringReader("""[{"a": 1,, "b": 2 }]""")))
    results in
    JsonArray(value=[a,b])
    and not an error
  • r

    robstoll

    11/21/2023, 11:35 AM
    @cedric ☝️ can you help out?
  • c

    cedric

    11/22/2023, 1:32 AM
    Sorry @robstoll, I haven't worked on Klaxon in a while 😕
    r
    • 2
    • 1
  • r

    Raymond Barlow

    12/19/2023, 11:08 AM
    Any news on when the next version is out? I would like to use the KlaxonSettings functionality, which was merged Jun 9, 2022 The latest version is
    5.6
    , which was tagged Mar 12, 2022 I assume this means the settings code is waiting on master for the next version release ?
  • c

    cedric

    12/21/2023, 5:13 AM
    Sorry, I haven't worked on Klaxon in quite a while...
  • g

    Gopal S Akshintala

    11/05/2024, 6:27 AM
    A beginner question, what is the advantage of using low-level-api in Klaxon compared to JSONObject, JSONArray etc in other libraries like org.json.json, jackson etc? TIA
  • m

    Mario Ruiz

    03/22/2025, 3:52 PM
    Is there any way we can revive klaxon? I like to use it as a replacement for gson because gson has given me a lot of headaches, but with the last release being 3 years ago I no longer feel confident in pulling it into new code.
  • c

    cedric

    03/22/2025, 4:29 PM
    Hi @Mario Ruiz. Well, I'm no longer maintaining it but if you'd like to, I'm happy to add you as a contributor