-
Notifications
You must be signed in to change notification settings - Fork 95
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
Ordering of map fields #7565
base: staging
Are you sure you want to change the base?
Ordering of map fields #7565
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import io.circe.Json._ | |
import pl.touk.nussknacker.engine.api.DisplayJson | ||
import java.util.ServiceLoader | ||
import java.util.UUID | ||
import scala.collection.immutable.ListMap | ||
import scala.jdk.CollectionConverters._ | ||
|
||
object ToJsonEncoder { | ||
|
@@ -66,7 +67,7 @@ case class ToJsonEncoder( | |
case a: UUID => safeString(a.toString) | ||
case a: DisplayJson => a.asJson | ||
case a: scala.collection.Map[_, _] => encodeMap(a.toMap) | ||
case a: java.util.Map[_, _] => encodeMap(a.asScala.toMap) | ||
case a: java.util.Map[_, _] => encode(ListMap(a.asScala.toList: _*)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might by not optimal. You should check what is done in implementation. Maybe there is some better approach when we assume that given map is a |
||
case a: Iterable[_] => fromValues(a.map(encode)) | ||
case a: Enum[_] => safeString(a.toString) | ||
case a: java.util.Collection[_] => fromValues(a.asScala.map(encode)) | ||
|
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.
Does it check the order? I think that the intent would be more clear if you'd compare lists instead