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

smithy.api.UniqueItems.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0-41-91762fb
Show newest version
package smithy.api

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

/** Indicates that the items in a list MUST be unique. */
final case class UniqueItems()

object UniqueItems extends ShapeTag.Companion[UniqueItems] {
  val id: ShapeId = ShapeId("smithy.api", "uniqueItems")

  val hints: Hints = Hints(
    smithy.api.Documentation("Indicates that the items in a list MUST be unique."),
    smithy.api.Trait(selector = Some("list :not(> member ~> :is(float, double, document))"), structurallyExclusive = None, conflicts = Some(List(smithy.api.NonEmptyString("smithy.api#sparse"))), breakingChanges = Some(List(smithy.api.TraitDiffRule(change = smithy.api.TraitChangeType.PRESENCE.widen, severity = smithy.api.Severity.WARNING.widen, path = None, message = None)))),
  ).lazily


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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy