Skip to content

Commit e4c0e18

Browse files
authored
compat: ensure '.withRequireDiscriminatorFirst(false)' is set on relevant makeOpenapiLike methods in scala 3 (#1301)
1 parent c3b6bae commit e4c0e18

File tree

1 file changed

+2
-0
lines changed
  • jsoniter-scala-macros/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros

1 file changed

+2
-0
lines changed

jsoniter-scala-macros/shared/src/main/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ object JsonCodecMaker {
704704

705705
def makeOpenapiLike[A: Type](discriminatorFieldName: Expr[String])(using Quotes): Expr[JsonValueCodec[A]] =
706706
make(CodecMakerConfig.withTransientEmpty(false).withTransientDefault(false)
707+
.withRequireDiscriminatorFirst(false)
707708
.withRequireCollectionFields(true).withAllowRecursiveTypes(true)
708709
.withDiscriminatorFieldName(Some(discriminatorFieldName.valueOrAbort)))
709710

@@ -712,6 +713,7 @@ object JsonCodecMaker {
712713
make(
713714
CodecMakerConfig.withTransientEmpty(false).withTransientDefault(false)
714715
.withRequireCollectionFields(true).withAllowRecursiveTypes(true)
716+
.withRequireDiscriminatorFirst(false)
715717
.withDiscriminatorFieldName(Some(discriminatorFieldName.valueOrAbort))
716718
.withAdtLeafClassNameMapper(ExprPartialFunctionWrapper(adtLeafClassNameMapper).apply.unlift
717719
.compose(PartialFunction.fromFunction(simpleClassName))))

0 commit comments

Comments
 (0)