twitter4s | asynchronous non-blocking Scala client | HTTP library
kandi X-RAY | twitter4s Summary
kandi X-RAY | twitter4s Summary
[Chat] An asynchronous non-blocking Scala Twitter Client, implemented using Akka-Http and json4s.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of twitter4s
twitter4s Key Features
twitter4s Examples and Code Snippets
Community Discussions
Trending Discussions on twitter4s
QUESTION
I use https://github.com/DanielaSfregola/twitter4s and I need to read and parse the User class provided by twitter4s in Json.
So I tried to create the following serializer :
...ANSWER
Answered 2017-May-04 at 09:19Your problem is that User
has a LOT of fields (namely more than 22). In scala 2.10, there was a limitation on the number of fields for a case class. This disappeared in 2.11, but not in the Json.format
macro of Play!, since they have continued support for 2.10.
However, you can use Json Extra, that have a different implementation for macros, and allows you to go further than 22 fields.
If you don't like this (the macro has some limitations, such as not outputing an OFormat
), you can also split the User
class in two (or more) classes with less than 22 fields, and build the initial one from those, with a simpler (and safer) implementation for Format
that what you would have to do, if you did the whole thing by hand.
You can also read this question, for further explanations.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install twitter4s
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page