File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
modules/core/src/smithy4s/schema Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ final case class Field[S, A](
4141 @ deprecated(" use .schema instead" , since = " 0.18.0" )
4242 final def instance : Schema [A ] = schema
4343
44- lazy val getDefaultValue : Option [A ] =
44+ def getDefaultValue : Option [A ] =
4545 schema.getDefaultValue
4646
4747 def isDefaultValue (a : A ): Boolean = getDefaultValue.contains(a)
Original file line number Diff line number Diff line change @@ -104,14 +104,15 @@ sealed trait Schema[A]{
104104 final def getDefault : Option [Document ] =
105105 this .hints.get(smithy.api.Default ).map(_.value)
106106
107- final def getDefaultValue : Option [A ] = {
107+ private final lazy val defaultValue : Option [A ] = {
108108 val maybeDefault = getDefault.flatMap[A ] {
109109 case Document .DNull => this .compile(DefaultValueSchemaVisitor )
110110 case document => Document .Decoder .fromSchema(this ).decode(document).toOption
111111 }
112112 maybeDefault.orElse(this .compile(OptionDefaultVisitor ))
113113 }
114114
115+ final def getDefaultValue : Option [A ] = defaultValue
115116
116117 /**
117118 * When applied on a structure schema, creates a schema that, when compiled into
You can’t perform that action at this time.
0 commit comments