How to resolve ambiguous implicit values in Scala for parsing JSON in Play Json?

killingtime1

I'm getting an error

ScalaFiddle.scala:45: error: ambiguous implicit values:

both getter _ewriter in module class ScalaFiddle of type => 
json.this.Reads[ScalaFiddle.this.SportJSON]

and getter _jwriter in module class ScalaFiddle of type => 
json.this.Reads[ScalaFiddle.this.Score]

match expected type json.this.Reads[T]
val result: Soccer=Json.fromJson(t2).get
                              ^

Anyone know what this means or any hints on what to read to resolve?

In general, I've also tried Circe and Spray (no luck either), do these macros rely on the field names being exactly the same as the json field names?

Thanks!

Code in question: https://scalafiddle.io/sf/BOUqhMz/0

Edit: Json in question, thanks! https://pastebin.com/usScQWd7

bmateusz

Write Json.fromJson[Soccer](t2).get

I did not understand your schema but that is how you pass the implicit

https://scalafiddle.io/sf/BOUqhMz/3

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

play json writes subclass gives ambiguous implicit values error

From Dev

If statements within Play/Scala JSON parsing?

From Dev

get Json Values in Scala scala.util.parsing.json.JSON

From Dev

How to resolve ambiguous implicit conversion method that takes same input type in Scala?

From Dev

Play Framework and Scala Json, parsing for json containing JSArray and JSObject

From Dev

Scala - How to implement implicit JSON reader

From Dev

How resolve Problem with Parsing Json in MyObject?

From Dev

JSON reads with hardcoded values in Play framework (Scala)

From Dev

Scala trait: How to require output parameter to be Numeric: ambiguous implicit values error

From Dev

Play Framework 2 in Scala: Parsing variadic JSON format?

From Dev

Finding the implicit value for Json in play

From Dev

How to resolve ambiguous method reference in scala

From Dev

Scala multiple implicit parameters with defaults resulting in ambiguous values

From Dev

Ambiguous implicit values

From Dev

Parsing and manipulating json in Scala

From Dev

Parsing nodes on JSON with Scala -

From Dev

How to define an implicit deserializer using Play Json for generic types

From Dev

Scala activerecord with implicit json format

From Dev

How does the Scala compiler resolve an implicit conversion

From Dev

Ambiguous reference to member 'subscript' when parsing json

From Dev

How to create JSON object in Scala/Play

From Dev

Play [Scala]: How to flatten a JSON object

From Dev

Scala Play - How to format Generics for JSON conversion

From Dev

How to parse JSON with variable keys in Scala Play?

From Dev

How to load JSON file using Play with Scala

From Dev

How to properly validate and transform a json in play scala?

From Dev

Scala Play - How to format Generics for JSON conversion

From Dev

Scala Play Json Reads

From Dev

Restructure a json in scala play

Related Related

  1. 1

    play json writes subclass gives ambiguous implicit values error

  2. 2

    If statements within Play/Scala JSON parsing?

  3. 3

    get Json Values in Scala scala.util.parsing.json.JSON

  4. 4

    How to resolve ambiguous implicit conversion method that takes same input type in Scala?

  5. 5

    Play Framework and Scala Json, parsing for json containing JSArray and JSObject

  6. 6

    Scala - How to implement implicit JSON reader

  7. 7

    How resolve Problem with Parsing Json in MyObject?

  8. 8

    JSON reads with hardcoded values in Play framework (Scala)

  9. 9

    Scala trait: How to require output parameter to be Numeric: ambiguous implicit values error

  10. 10

    Play Framework 2 in Scala: Parsing variadic JSON format?

  11. 11

    Finding the implicit value for Json in play

  12. 12

    How to resolve ambiguous method reference in scala

  13. 13

    Scala multiple implicit parameters with defaults resulting in ambiguous values

  14. 14

    Ambiguous implicit values

  15. 15

    Parsing and manipulating json in Scala

  16. 16

    Parsing nodes on JSON with Scala -

  17. 17

    How to define an implicit deserializer using Play Json for generic types

  18. 18

    Scala activerecord with implicit json format

  19. 19

    How does the Scala compiler resolve an implicit conversion

  20. 20

    Ambiguous reference to member 'subscript' when parsing json

  21. 21

    How to create JSON object in Scala/Play

  22. 22

    Play [Scala]: How to flatten a JSON object

  23. 23

    Scala Play - How to format Generics for JSON conversion

  24. 24

    How to parse JSON with variable keys in Scala Play?

  25. 25

    How to load JSON file using Play with Scala

  26. 26

    How to properly validate and transform a json in play scala?

  27. 27

    Scala Play - How to format Generics for JSON conversion

  28. 28

    Scala Play Json Reads

  29. 29

    Restructure a json in scala play

HotTag

Archive