Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play: Fully qualify js readers/writers #701

Merged
merged 2 commits into from
Jul 3, 2024
Merged

Play: Fully qualify js readers/writers #701

merged 2 commits into from
Jul 3, 2024

Conversation

mbryzek
Copy link
Collaborator

@mbryzek mbryzek commented Jul 3, 2024

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)
       }
     }

@mbryzek mbryzek merged commit 3ebda99 into main Jul 3, 2024
1 of 2 checks passed
@mbryzek mbryzek deleted the qualify_js_methods branch July 3, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant