pont/spec

Types

pub type Format {
  DateFormat
  DatetimeFormat
  I32Format
  I64Format
  F32Format
  F64Format
  PasswordFormat
  ByteFormat
  BinaryFormat
  CustomFormat(format: String)
}

Constructors

  • DateFormat
  • DatetimeFormat
  • I32Format
  • I64Format
  • F32Format
  • F64Format
  • PasswordFormat
  • ByteFormat
  • BinaryFormat
  • CustomFormat(format: String)
pub type ObjectField {
  ObjectField(name: String, spec: Spec, required: Bool)
}

Constructors

  • ObjectField(name: String, spec: Spec, required: Bool)
pub type Spec {
  String(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    enum_variants: List(String),
    pattern: option.Option(String),
  )
  Integer(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    min: option.Option(Int),
    max: option.Option(Int),
  )
  Float(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    min: option.Option(Float),
    max: option.Option(Float),
  )
  Boolean(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
  )
  Null(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
  )
  Array(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    of: Spec,
  )
  Option(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    of: Spec,
  )
  Object(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    fields: List(ObjectField),
  )
  Union(
    format: option.Option(Format),
    default: option.Option(value.Value),
    example: List(value.Value),
    variants: List(Spec),
  )
}

Constructors

Values

pub fn array(of: Spec) -> Spec
pub fn bool() -> Spec
pub fn float() -> Spec
pub fn float_within(min: Float, max: Float) -> Spec
pub fn int() -> Spec
pub fn int_within(min: Int, max: Int) -> Spec
pub fn null() -> Spec
pub fn object(fields: List(ObjectField)) -> Spec
pub fn option(of: Spec) -> Spec
pub fn string() -> Spec
pub fn string_enum(variants: List(String)) -> Spec
pub fn union(variants: List(Spec)) -> Spec
pub fn with_format(spec: Spec, format: Format) -> Spec
✨ Search Document