简体   繁体   English

Json Argonaut对于案例类来说太大了

[英]Json Argonaut Too Big For Case Class

There's an API I have no influence on that has a JSON result object with a member that has 23 fields. 有一个我没有影响的API,它的JSON结果对象的成员具有23个字段。 The paradigm of case classes doesn't work, because there's a limit of 22. I've seen Slick and other libraries use HLists to resolve this. 案例类的范例不起作用,因为限制为22。我已经看到Slick和其他库使用HLists来解决此问题。 Is there a way to do this in Argonaut? 在Argonaut中有没有办法做到这一点? If so, please give me sample piece of code to leverage. 如果是这样,请给我示例代码以加以利用。 Thank you! 谢谢!

object BusinessResults{
    implicit def BusinessResultsCodecJson: CodecJson[BusinessResults] =
      casecodec23(BusinessResults.apply, BusinessResults.unapply)( /**... 23 fields ...**/)
  }

I did not create an elegant solution for this. 我没有为此创建一个优雅的解决方案。 I just hand jammed a 23 piece for-comprehension to create the decoder. 我只是用手捏了23块才能产生解码器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM