JSON to scala case class will produce weird case classes
See original GitHub issueIn the example at https://transform.now.sh/json-to-scala-case-class, it translates a JSON array to a Scala Array
. Unfortunately, Scala Array
is just a wrapper for Java arrays, which have reference equality. That means that equality between case class instances produced using this tool will not have sensible equality (because distinct arrays containing the same elements will be considered different).
A simple solution would be to switch Array
to Seq
or IndexedSeq
, which will have sensible equality.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Scala: Parse JSON directly into a case class - Stack Overflow
Given a string of JSON, and a case ...
Read more >Generate Scala Case Classes From JSON Schema - Medium
Case Class Generator can transform advanced JSON schemas into nested case classes with bunch of configuration settings.
Read more >How to create a simple Scala object from a JSON String
You need to convert a JSON string into a simple Scala object, such as a Scala case class that has no collections.
Read more >Re: Is it possible to serialize / deserialize case classes without ...
I want to serialize case classes to json. ... Using this approach I have to define a protocol for each class which is...
Read more >9. Objects, Case Classes, and Traits - Learning Scala [Book]
Neither of these function types are well suited to being class methods because they have little to do with a class's fields. As...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the quick response!
fix is live.