-
Notifications
You must be signed in to change notification settings - Fork 26
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
opaque json mappping #460
opaque json mappping #460
Conversation
build.sbt
Outdated
@@ -121,6 +121,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) | |||
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.5.0", | |||
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)) | |||
) | |||
.platformsSettings(JSPlatform, NativePlatform)(bspEnabled := false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe bsp was turned off a different way in #458
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool I'll undo that.
Can't this be achieved with a |
Yes, but you need a PrefixMapping for every type in the subtree, which in our particular case is a lot. You can also do this by overriding |
That's bad, agreed. But maybe we can come up with a generalization of |
In our case it's universal (if the parent is a circe cursor then the child should also be a circe cursor) but more generally if the path from the root is X/Y/Z then all children should be circe cursors. The solution I propose here marks this at the parent node X/Y/Z rather than marking it at all child nodes X/Y/Z/**/Q. |
See #461. |
Superseded by #565. |
This adds an
opaque: Boolean = false
argument to the constructors for mappings that are backed by CirceCursor. If this field iftrue
then the underlying JSON is considered to be the final result and no attempt is made to hop into other mappings if another mapped type is encountered during traversal. The use case is a deep structure that appears twice as a return type in the schema, served in one place by a SQL mapping and in another place by a computed JSON mapping.This also turns off BSP processing for non-JVM projects. I think this may have already been done on another branch.