java - Process json with different data type in Circe -


in case, there might different data type of same json field. example:

"need_exp":1500 

or

"need_exp":"-" 

how process case? know can processed parse or use custom encoders, complex json text, there way solve without rewriting whole decoder (for example, "tell" decoder convert int string in need_exp field)?

it called disjunction can encoded scala standard either class. map json following class:

case class foo(need_exp: either[string, int]) 

Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

nginx - phpPgAdmin - log in works but I have to login again after clicking on any links -