apicollective / apibuilder-generator

MIT License
54 stars 36 forks source link

Play: Fully qualify js readers/writers #701

Closed mbryzek closed 2 months ago

mbryzek commented 2 months ago

This fixed a bug where if you import services that define the same model, previously there would be multiple matching methods. Here we explicitly select the correct reader/writer.

-    implicit def jsonReadsApibuilderGeneratorInvocation: play.api.libs.json.Reads[Invocation] = {
+    implicit def jsonReadsApibuilderGeneratorInvocation: play.api.libs.json.Reads[io.apibuilder.generator.v0.models.Invocation] = {
       for {
         source <- (__ \ "source").read[String]
         files <- (__ \ "files").read[Seq[io.apibuilder.generator.v0.models.File]]
@@ -329,11 +329,11 @@ package io.apibuilder.generator.v0.models {

     implicit def jsonWritesApibuilderGeneratorInvocation: play.api.libs.json.Writes[Invocation] = {
       (obj: io.apibuilder.generator.v0.models.Invocation) => {
-        jsObjectInvocation(obj)
+        io.apibuilder.generator.v0.models.json.jsObjectInvocation(obj)
       }
     }