All Downloads are FREE. Search and download functionalities are using the official Maven repository.

alloy.Nullable.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0-41-91762fb
Show newest version
package alloy

import smithy4s.Hints
import smithy4s.Schema
import smithy4s.ShapeId
import smithy4s.ShapeTag
import smithy4s.schema.Schema.constant

/** Use this trait to mark some field as nullable. This is to make
  * a distinction between an optional field that is missing and one
  * that's explicitly set to null.
  */
final case class Nullable()

object Nullable extends ShapeTag.Companion[Nullable] {
  val id: ShapeId = ShapeId("alloy", "nullable")

  val hints: Hints = Hints(
    smithy.api.Documentation("Use this trait to mark some field as nullable. This is to make\na distinction between an optional field that is missing and one\nthat\'s explicitly set to null."),
    smithy.api.Trait(selector = Some(":not([trait|trait])"), structurallyExclusive = None, conflicts = None, breakingChanges = None),
  ).lazily


  implicit val schema: Schema[Nullable] = constant(Nullable()).withId(id).addHints(hints)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy